Hi Folks!
Please, I need to lower the sidebar to have white space at the top. Any suggestion?
I attached this image to illustrate.
Thank in advance.
Hi @luciano_Mattar ,
You can achieve this by placing empty st.image or st.text components at the top of your sidebar.
And adjusting itβs width.
Thanks sai_krishna1 for your help!
Iβm looking for something like this link [css - How to change the height of streamlit sidebar - Stack Overflow].
import streamlit as st
st.markdown("""
<style>
section[data-testid="stSidebar"][aria-expanded="true"]{
height: 80% !important;
}
section[data-testid="stSidebar"][aria-expanded="false"]{
height: 80% !important;
}
</style>""", unsafe_allow_html=True)
st.sidebar.markdown("Adjust sidebar height")
The code do the opposite, but unfortunately I wasnβt able to adapt it to my code - I have no expertise in HTML and CSS. Please, any suggestion?
I managed to adapt the code.
st.markdown("""
<style>
section[data-testid="stSidebar"] {
top: 50%;
height: 80% !important;
}
</style>""", unsafe_allow_html=True)