|
32 | 32 | /* 置中 footer 內容 */ |
33 | 33 | .footer { |
34 | 34 | text-align: center; |
| 35 | + width: 100%; |
| 36 | + overflow-x: hidden; |
35 | 37 | } |
36 | 38 |
|
37 | 39 | .footer__links { |
38 | 40 | justify-content: center !important; |
39 | 41 | display: flex !important; |
40 | | - flex-wrap: nowrap !important; |
41 | | - gap: 0 !important; |
| 42 | + flex-wrap: wrap !important; /* 改為 wrap,允許換行 */ |
| 43 | + gap: 2rem 0 !important; /* 調整間距 */ |
42 | 44 | } |
43 | 45 |
|
44 | 46 | .footer__col { |
45 | 47 | text-align: center; |
46 | 48 | } |
47 | 49 |
|
48 | | -/* Pages 欄位(第一欄)靠近 More */ |
49 | | -.footer__col:nth-child(1) { |
50 | | - margin-right: 3rem; |
51 | | -} |
| 50 | +/* Pages 欄位(第一欄)靠近 More - 僅在桌面版生效 */ |
| 51 | +@media (min-width: 769px) { |
| 52 | + .footer__col:nth-child(1) { |
| 53 | + margin-right: 3rem; |
| 54 | + } |
52 | 55 |
|
53 | | -/* More 欄位(第二欄) */ |
54 | | -.footer__col:nth-child(2) { |
55 | | - margin-left: 0; |
| 56 | + .footer__col:nth-child(2) { |
| 57 | + margin-left: 0; |
| 58 | + } |
| 59 | + |
| 60 | + .footer__links { |
| 61 | + flex-wrap: nowrap !important; /* 桌面版不換行 */ |
| 62 | + } |
56 | 63 | } |
57 | 64 |
|
58 | 65 | .footer__copyright { |
|
87 | 94 | color: #d4c4b0 !important; |
88 | 95 | } |
89 | 96 |
|
90 | | -/* 將 Pages 區塊的項目改為兩欄三列佈局(垂直排列)*/ |
91 | | -.footer__links .footer__col:first-child .footer__items { |
92 | | - display: grid !important; |
93 | | - grid-template-columns: repeat(2, auto) !important; |
94 | | - grid-auto-flow: column !important; |
95 | | - grid-template-rows: repeat(3, auto) !important; |
96 | | - gap: 0.5rem 3rem !important; |
97 | | - max-width: 400px !important; |
98 | | - margin: 0 auto !important; |
| 97 | +/* 將 Pages 區塊的項目改為兩欄三列佈局(垂直排列)- 僅桌面版 */ |
| 98 | +@media (min-width: 769px) { |
| 99 | + .footer__links .footer__col:first-child .footer__items { |
| 100 | + display: grid !important; |
| 101 | + grid-template-columns: repeat(2, auto) !important; |
| 102 | + grid-auto-flow: column !important; |
| 103 | + grid-template-rows: repeat(3, auto) !important; |
| 104 | + gap: 0.5rem 3rem !important; |
| 105 | + max-width: 400px !important; |
| 106 | + margin: 0 auto !important; |
| 107 | + } |
99 | 108 | } |
100 | 109 |
|
101 | | -/* 使用 grid-auto-flow: column 會自動按照垂直順序填充 */ |
102 | | -/* 項目會自動排列成: |
103 | | - 第1項(專題文章)→ 左欄第1列 |
104 | | - 第2項(日常思考)→ 左欄第2列 |
105 | | - 第3項(我的書櫃)→ 左欄第3列 |
106 | | - 第4項(慢行生活)→ 右欄第1列 |
107 | | - 第5項(教育倡議)→ 右欄第2列 |
108 | | - 第6項(關於我)→ 右欄第3列 |
109 | | -*/ |
110 | | - |
111 | 110 | /* 響應式設計:在小螢幕上恢復單欄佈局 */ |
112 | 111 | @media (max-width: 768px) { |
| 112 | + .footer { |
| 113 | + padding: 2rem 1rem; |
| 114 | + } |
| 115 | + |
| 116 | + .footer__links { |
| 117 | + flex-direction: column; |
| 118 | + gap: 2rem !important; |
| 119 | + } |
| 120 | + |
| 121 | + .footer__col { |
| 122 | + width: 100%; |
| 123 | + margin: 0 !important; |
| 124 | + } |
| 125 | + |
113 | 126 | .footer__col:first-child .footer__items { |
114 | | - grid-template-columns: 1fr !important; |
115 | | - grid-template-rows: auto !important; |
| 127 | + display: flex !important; |
| 128 | + flex-direction: column !important; |
| 129 | + gap: 0.5rem !important; |
116 | 130 | } |
117 | 131 |
|
118 | 132 | .footer__col:first-child .footer__item { |
|
0 commit comments