a multiselect with a different default color
To upload files, please first save the app
import streamlit as st
st.markdown("""
<style>
span[data-baseweb="tag"] {
color: white;
background-color: gray;
}
span[data-baseweb="tag"]:has(span[title="Yellow"]) {
color: black;
background-color: yellow;
}
span[data-baseweb="tag"]:has(span[title="Red"]) {
color: black;
background-color: red;
}
span[data-baseweb="tag"]:has(span[title="Green"]) {
color: black;
background-color: green;
}
</style>
""", unsafe_allow_html=True)
st.title('Changing multiselect color')
values = ["Green", "Yellow", "Red", "Blue", "Black"]
options = st.multiselect("What are your favorite colors", values, values)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?