hello,
for this code snippet
st.radio("Choose the order type", ["A", "B"] )
how can i change the text color of “Choose the order type”. I want the color specifically to be white
Please help.
Thanks
hello,
for this code snippet
st.radio("Choose the order type", ["A", "B"] )
how can i change the text color of “Choose the order type”. I want the color specifically to be white
Please help.
Thanks
Hi @Jino_R,
Thanks for posting!
Are you going to use a dark background? If yes, then you won’t need to specify the color since white will be the default. The following are the supported colors using the syntax :color[text to be colored]
: blue, green, orange, red, violet, gray/grey, and rainbow.
Here’s a shot at a workaround if using white is a must. However we introduce markdown for the text;
import streamlit as st
st.markdown("""
<style>
label[for*="streamlit"] {
color: white;
}
</style>
""", unsafe_allow_html=True)
st.markdown('<p style="color:white;">Choose the order type</p>', unsafe_allow_html=True)
choice = st.radio("", ["A", "B"])
thanks , but using markdown, theres a huge space that appears betwwen the choices A and B and the markdown text, how to fix that
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.