Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to make label in st.multiselect bigger/bolder

I am looking to make the label of multiselect bigger / bolder, my code looks like this :

choice_mode = st.multiselect("Chose Mode", ['A','B','C'], default="*")

I have tried adding this :

st.markdown(".stTextInput > label {font-size:105%; font-weight:bold; color:blue;} ",unsafe_allow_html=True) #for all text-input label sections

st.markdown(".stMultiSelect > label {font-size:105%; font-weight:bold; color:blue;} ",unsafe_allow_html=True) #for all multi-select label sections

from this page : https://discuss.streamlit.io/t/the-problem-changing-label-font-of-text-input-and-multi-select/23329

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

but all it does is display the text on my app like so :
enter image description here

Am I doing this wrong? Could it be the streamlit version?

>Solution :

You should have the css in a <style>

st.markdown("""
<style>
.stTextInput > label {
font-size:105%; 
font-weight:bold; 
color:blue;
}

.stMultiSelect > label {
font-size:105%; 
font-weight:bold; 
color:blue;
} 
</style>
""", unsafe_allow_html=True)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading