Create a streamlit application with a banner at the top in color blue, and in the banner the text "My application." Below the banner, put 3 drop-down fields listing random info just for reference. The rest of the site needs to be in black.
To upload files, please first save the app
import streamlit as st
# Set page config with dark theme
st.set_page_config(layout="wide")
# Custom CSS for the banner and page background
st.markdown(
"""
<style>
.banner {
padding: 20px;
background-color: blue;
color: white;
text-align: center;
font-size: 24px;
margin-bottom: 20px;
}
/* Set the background color for the main content */
.stApp {
background-color: black;
color: white;
}
</style>
""",
unsafe_allow_html=True
)
# Banner
st.markdown('<div class="banner">My Application</div>', unsafe_allow_html=True)
# Dropdown fields
option1 = st.selectbox(
'Select a fruit',
['Apple', 'Banana', 'Orange', 'Mango', 'Pineapple']
)
option2 = st.selectbox(
'Select a country',
['USA', 'Canada', 'UK', 'France', 'Germany', 'Japan']
)
option3 = st.selectbox(
'Select a color',
['Red', 'Blue', 'Green', 'Yellow', 'Purple', 'Pink']
)
# Display selected options
st.write('You selected:')
st.write(f'Fruit: {option1}')
st.write(f'Country: {option2}')
st.write(f'Color: {option3}')
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?