How do I remove the underline part of the selected tab using st.tabs?
Hello,
You can inject some CSS code
# Inject custom CSS to remove tab underlines and borders
st.markdown("""
<style>
/* Remove animated highlight bar under tab */
div[data-baseweb="tab-highlight"] {
background-color: transparent ;
}
/* Remove tab border element */
div[data-baseweb="tab-border"] {
display: none ;
}
}
</style>
""", unsafe_allow_html=True)
tab1, tab2, tab3 = st.tabs(["Tab 1", "Tab 2", "Tab 3"])
with tab1:
st.write("Content in Tab 1")
with tab2:
st.write("Content in Tab 2")
with tab3:
st.write("Content in Tab 3")