Custom the form background-color

import streamlit as st

with st.form("My form"):
    first = st.text_input("First name")
    last = st.text_input("Last name")
    if st.form_submit_button("Submit"):
        st.write(first+" "+last)

css="""
<style>
    [data-testid="stForm"] {
        background: LightBlue;
    }
</style>
"""
st.write(css, unsafe_allow_html=True)

1 Like