Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ import qrcode
|
|
| 8 |
from PIL import Image
|
| 9 |
import io
|
| 10 |
|
| 11 |
-
# 自訂 CSS
|
| 12 |
st.markdown("""
|
| 13 |
<style>
|
| 14 |
.stApp header h1 {
|
|
@@ -22,6 +22,17 @@ st.markdown("""
|
|
| 22 |
max-height: 80vh; /* 圖片高度接近視窗高度 */
|
| 23 |
object-fit: contain; /* 保持比例 */
|
| 24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
</style>
|
| 26 |
""", unsafe_allow_html=True)
|
| 27 |
|
|
|
|
| 8 |
from PIL import Image
|
| 9 |
import io
|
| 10 |
|
| 11 |
+
# 自訂 CSS 確保標題不換行、調整圖片大小並優化按鈕布局
|
| 12 |
st.markdown("""
|
| 13 |
<style>
|
| 14 |
.stApp header h1 {
|
|
|
|
| 22 |
max-height: 80vh; /* 圖片高度接近視窗高度 */
|
| 23 |
object-fit: contain; /* 保持比例 */
|
| 24 |
}
|
| 25 |
+
/* 調整按鈕樣式以確保對稱 */
|
| 26 |
+
.stButton > button {
|
| 27 |
+
width: 100px; /* 固定按鈕寬度 */
|
| 28 |
+
text-align: center; /* 文字居中 */
|
| 29 |
+
padding: 5px 10px; /* 調整內部間距 */
|
| 30 |
+
margin: 0 auto; /* 水平居中 */
|
| 31 |
+
}
|
| 32 |
+
/* 確保列寬度均等 */
|
| 33 |
+
.st-ds {
|
| 34 |
+
justify-content: space-between; /* 兩列間距均等 */
|
| 35 |
+
}
|
| 36 |
</style>
|
| 37 |
""", unsafe_allow_html=True)
|
| 38 |
|