Background-color

Hey streamLIT community!
Firstly thanks for creating an amazing tool!
Building web-apps was never this easy
Here is my issue:
Is there a provision to change the background color of the main screen /sidebar
I have seen suggestions to use in markdown,but that does not seem to solve my problem,is there any other way out
Thanks!

Welcome to the Streamlit community @MANIRATNA_SARNESH, and great to hear you’re having success with Streamlit!

When you say “it doesn’t solve my problem”, could you be more specific? If you can post a code snippet of what you tried, we might be able to help you achieve what you want.

Best,
Randy

Hey Randy,
Okay so I am actually trying to have different background colors for the main page and the sidebar.
As suggested in some of the discussion forums I have tried it using st.markdown() with unsafe_allow_html=True
Please correct me if I am wrong
Here is the code snippet:
st.markdown("<span style=“background-color:#121922”>",unsafe_allow_html=True)
This does not seem to have set the background color
Cheers,
Saranesh

Hey @MANIRATNA_SARNESH

I don’t have my computer to test but I think your css code only applies to the span element and not the body of the full page.

Can you try loading the css into the head of your app instead, using this snippet ?

Fanilo

1 Like