How to set the background color and text color of "st.header","st.write" etc. and let the text be showed at the left side of input and select box?

We now have a built-in feature to use colored text in st.write, st.markdown, st.header, etc:

st.markdown("This is black and :red[this is red!]")

You can use the colors blue, green, orange, red, violet, gray/grey, rainbow in the same way. See also the docstring of the body parameter.

2 Likes