I’m trying to to change the color of a tab (of all the tabs ) on my main page, so that it will remain transparent. I found the element in chrome’s devtool but just cant figure out how to translate that to style/style
The line in question is :
<div data-testid="stMarkdownContainer" class="css-16idsys e16nr0p34" style="background-color: green"><p>NAT GAS</p></div>
Use st.markdown()
st.markdown( """
<style>
.css-16idsys.e16nr0p34 {
background-color: green;
}
</style>
""", unsafe_allow_html=True)
Like a charm! Thank you so much!!!
import streamlit as st
Use st.markdown with unsafe_allow_html=True
st.markdown(‘
NAT GAS
Note: Be cautious when using unsafe_allow_html=True
as it allows you to inject custom HTML and CSS. Make sure the content you inject is safe and doesn’t introduce security vulnerabilities.
For more information on this topic, you can refer to the Streamlit documentation on markdown.
This should help you change the tab’s background color to green as you requested.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.