去除頂部大片空白
Browse files- src/streamlit_app.py +16 -2
src/streamlit_app.py
CHANGED
|
@@ -9,7 +9,7 @@ st.set_page_config(page_title="AI 新知小助手", page_icon="📚", layout="wi
|
|
| 9 |
st.markdown(
|
| 10 |
"""
|
| 11 |
<style>
|
| 12 |
-
/* 隱藏側邊欄捲軸 */
|
| 13 |
[data-testid="stSidebar"] section::-webkit-scrollbar {
|
| 14 |
display: none;
|
| 15 |
}
|
|
@@ -17,12 +17,26 @@ st.markdown(
|
|
| 17 |
-ms-overflow-style: none;
|
| 18 |
scrollbar-width: none;
|
| 19 |
}
|
| 20 |
-
|
|
|
|
| 21 |
.stButton button {
|
| 22 |
width: auto;
|
| 23 |
padding: 5px 15px;
|
| 24 |
border-radius: 20px;
|
| 25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
</style>
|
| 27 |
""",
|
| 28 |
unsafe_allow_html=True
|
|
|
|
| 9 |
st.markdown(
|
| 10 |
"""
|
| 11 |
<style>
|
| 12 |
+
/* 1. 隱藏側邊欄捲軸 */
|
| 13 |
[data-testid="stSidebar"] section::-webkit-scrollbar {
|
| 14 |
display: none;
|
| 15 |
}
|
|
|
|
| 17 |
-ms-overflow-style: none;
|
| 18 |
scrollbar-width: none;
|
| 19 |
}
|
| 20 |
+
|
| 21 |
+
/* 2. 調整範例按鈕樣式 */
|
| 22 |
.stButton button {
|
| 23 |
width: auto;
|
| 24 |
padding: 5px 15px;
|
| 25 |
border-radius: 20px;
|
| 26 |
}
|
| 27 |
+
|
| 28 |
+
/* 🚀 3. 新增:極度壓縮頂部空白與兩側邊距,專為小視窗優化 */
|
| 29 |
+
.block-container {
|
| 30 |
+
padding-top: 1.5rem !important;
|
| 31 |
+
padding-bottom: 1rem !important;
|
| 32 |
+
padding-left: 1rem !important;
|
| 33 |
+
padding-right: 1rem !important;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/* 🚀 4. 新增:隱藏 Streamlit 預設的頂部裝飾與漢堡選單 */
|
| 37 |
+
header {
|
| 38 |
+
visibility: hidden;
|
| 39 |
+
}
|
| 40 |
</style>
|
| 41 |
""",
|
| 42 |
unsafe_allow_html=True
|