Adding scrolls bars to expander is not working

import streamlit as st

with st.expander(‘Cat’):
st.write(‘Meow’ + ’ meow’*1000)

css=‘’’

[data-testid="stExpander"] div:has(>.streamlit-expanderContent) { overflow: scroll; height: 400px; }

‘’’

st.markdown(css, unsafe_allow_html=True)

This code is not working

Could you format your code properly?

import streamlit as st

with st.expander(‘Cat’):
st.write(‘Meow’ + ’ meow’ * 1000)

css = ‘’’
[data-testid=“stExpander”] div:has(>.streamlit-expanderContent) {
overflow: scroll;
height: 400px;
}
‘’’

st.markdown(css, unsafe_allow_html=True)

I’m running into the same issue. Any suggestions?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.