Summary
Hey everyone !
I’m turning to you for a little custom problem with one of my apps. As the title suggests, I’m trying to change the background color of a form. I’ve tried st.markdown but can’t find the right combination, which is where I need your help!
Thanks in advance !
Steps to reproduce
Code snippet:
first try :
st.markdown("""
<style>
.stForm {
background-color: #000000;
}
</style>
""", unsafe_allow_html=True)
Second try, using the class from web inspector
st.markdown("""
<style>
.st-emotion-cache-r421ms e10yg2by1 {
background-color: #000000;
}
</style>
""", unsafe_allow_html=True)
And some alternative like :
- st-emotion-cache-r421ms .e10yg2by1
- st-emotion-cache-r421ms
- div form
- using !important
Expected behavior:
So I just want to change the background color of my form and not using the transparent default
Debug info
- Streamlit version: streamlit==1.27.2
- Python version: 3.10.9
- PipEnv
- OS version: Windows 10
- Browser version: firefox 118.0.1