【发布时间】:2022-11-29 18:05:32
【问题描述】:
我尝试了几个变通方法来使用css更改流线型侧边栏的高度。我的方法之一是下面的代码,但它并没有解决我的问题。我在streamlit discussion forum 中找到了一些建议的方法,但这些方法也没有帮助。有人可以帮忙吗?
import streamlit as st
st.markdown(
"""
<style>
[data-testid="stSidebar"][aria-expanded="true"] > div:first-child {
height: 80% ;
}
[data-testid="stSidebar"][aria-expanded="false"] > div:first-child {
height: 80%
}
</style>
""",
unsafe_allow_html=True,
)
st.sidebar.markdown("Adjust sidebar height")
【问题讨论】: