79632263

Date: 2025-05-21 15:05:42
Score: 1.5
Natty:
Report link

Your syntax using st.container is right.

The issue seems to come from st.markdown:

  1. The syntax is not right because it misses """

  2. 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)

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Hippolytehh