create a streamlit app with a drop-box field inside the banner and another one inside a bar in color red
To upload files, please first save the app
import streamlit as st
# Custom CSS to style the colored bar
st.markdown(
"""
<style>
.red-bar {
background-color: red;
padding: 20px;
margin: 10px 0;
border-radius: 5px;
}
</style>
""",
unsafe_allow_html=True
)
# Add header with dropdown in the banner
col1, col2 = st.columns([3, 1])
with col1:
st.title("App with Dropdowns")
with col2:
banner_option = st.selectbox(
"Select from banner",
["Option 1", "Option 2", "Option 3"],
key="banner_dropdown"
)
# Add red bar with dropdown
st.markdown('<div class="red-bar">', unsafe_allow_html=True)
bar_option = st.selectbox(
"Select from red bar",
["Choice A", "Choice B", "Choice C"],
key="bar_dropdown"
)
st.markdown('</div>', unsafe_allow_html=True)
# Display selected values
st.write("You selected from banner:", banner_option)
st.write("You selected from red bar:", bar_option)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?