Display text inside text box of a particular color

Hey Community members
I have a teeny doubt but I can’t find its solution.
I have a string object and i am willing to display it inside a box of black color due to my background. Kindly provide the code for it pls

Hey @Varun_Nayyar,

I posted an answer to someone a while ago about how to change the colour of just one text element. You can use the same code to change your text colour, and just hardcode the colour you want:

Happy Streamlit-ing!

Thanks a lot

1 Like

How do I change text colour inside selectboxes and file uploaders individually?

Hey @jerry10,

You would have to use some custom CSS styling and the st.markdown with the unsafe_allow_html flag set to true. There are a number of examples in the community of people inserting custom CSS that way and if you use our search button I bet you could find some examples to work from!

Happy Streamlit-ing!