I'm trying to customize st.text_area
to a specific width and height using CSS - however, it is not responsive to width and height changes. Is there anything else I can try?
def main(): # Custom CSS to modify the textarea width and height custom_css = ''' <style> textarea.stTextArea { width: 800px !important; height: 400px !important; } </style> ''' st.write(custom_css, unsafe_allow_html=True) st.title("Custom Textarea Width and Height") user_input = st.text_area("Type your text here:") st.subheader("You typed:") st.write(user_input) if __name__ == "__main__": main()
You should use
markdown
for styling or html syntax instead ofwrite
and make sure you get the correct class.You can also set the height using the
height
parameter. inside If you don't need thetextarea.st-cl
part of the clothing css.or: