Change font size of tabs

Is it possible to change the font size when working with st.tabs()?


You can with a CSS hack:

import streamlit as st

animals = ['cat','dog','bird']

tabs = st.tabs(animals)

with tabs[0]:
    st.write('Meow' + ' meow'*100)
with tabs[1]:
    st.write('Woof' + ' woof'*100)
with tabs[2]:
    st.write('Tweet' + ' tweet'*100)

css = '''
    .stTabs [data-baseweb="tab-list"] button [data-testid="stMarkdownContainer"] p {

st.markdown(css, unsafe_allow_html=True)
1 Like

Very good, thanks.