Your syntax using st.container
is right.
The issue seems to come from st.markdown
:
The syntax is not right because it misses """
The HTML markdown cannot be rendered without unsafe_allow_html= True
Here's a working solution (using streamlit==1.41.1
) where the st-key-container1
can be found in the HTML source code:
import streamlit as st
with st.container(key = "container1"):
st.markdown("""<div><img src='path/to/your/image.png'</div>""", unsafe_allow_html= True)