Gowtham
September 12, 2024, 8:36am
1
col1, col2 = st.columns([1.5, 2])
with col1:
with st.container(height=550, border=True):
container1()
with col2:
with st.container(height=550, border=True):
container2()
with st.container(height=500, border=True):
container3()
with st.container(height=500, border=True):
container4()
Is it possible to change the background color and text color of each container?
edsaac
September 12, 2024, 12:24pm
2
You could use a styleable container from the streamlit-extras
package.
https://arnaudmiribel.github.io/streamlit-extras/extras/stylable_container/
Soon , it will be possible to target individual elements’ style using their key:
streamlit:develop
← streamlit:feature/add-key-to-container
opened 09:08PM - 16 Aug 24 UTC
## Describe your changes
Adds support for setting a CSS class on elements usi… ng the `key` parameter. The key gets prefixed with `st-key-` and slugified to conform with the class naming rules. This PR also adds support for setting a `key` on `st.container`, which provides a very flexible way to set CSS keys for any element.
## GitHub Issue Link (if applicable)
- Closes https://github.com/streamlit/streamlit/issues/3888
- Closes https://github.com/streamlit/streamlit/issues/5437
## Testing Plan
- Added e2e tests.
---
**Contribution License Agreement**
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
3 Likes
system
Closed
September 14, 2024, 12:25pm
3
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.