-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
362 lines (300 loc) · 7.78 KB
/
Copy pathstyle.css
File metadata and controls
362 lines (300 loc) · 7.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
body {
margin: 0;
padding: 0;
padding-top: 70px;
/* 為固定導覽列預留空間 */
font-family: Arial, sans-serif;
line-height: 1.6;
color: black;
background: white;
}
.container {
padding-left: 20px;
padding-right: 20px;
max-width: 960px;
margin: 0 auto;
}
/* 導覽列容器的樣式 */
nav {
background-color: #2C3E50;
padding: 10px 0;
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 1000;
box-sizing: border-box;
height: auto;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
/* 移除 justify-content: center; 以便項目可以從左邊開始排列,
並在滾動時顯示更多項目。如果項目較少時仍希望居中,可以用媒體查詢處理。
align-items: center; 仍然保留,用於垂直居中。*/
align-items: center;
/* 新增:水平滾動的關鍵屬性 */
overflow-x: auto;
/* 當內容超出容器時,允許水平滾動 */
-webkit-overflow-scrolling: touch;
/* 改善 iOS 裝置上的滾動流暢度 */
white-space: nowrap;
/* 確保所有 li 元素都在同一行,不換行 */
/* 選用:隱藏滾動條(僅在需要時使用,可提升視覺美觀但可能降低可發現性) */
scrollbar-width: none;
/* For Firefox */
-ms-overflow-style: none;
/* For Internet Explorer and Edge */
}
/* For Chrome, Safari and Opera (隱藏滾動條) */
nav ul::-webkit-scrollbar {
display: none;
}
/* 每個列表項目的樣式 */
nav ul li {
/* 這裡的 margin 可以保持,它會在項目之間提供空間 */
margin: 0 15px;
/* 新增:確保項目不會被壓縮,保留其原始寬度 */
flex-shrink: 0;
}
/* 連結的樣式 */
nav ul li a {
text-decoration: none;
color: #FFFFFF;
padding: 5px 0;
display: block;
}
/* 連結在滑鼠懸停時的樣式 */
nav ul li a:hover {
text-decoration: underline;
}
/* ==================================== */
/* 錨點跳轉偏移解決方案 */
h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id] {
scroll-margin-top: 70px;
}
td {
padding: 20px;
}
.photo {
width: 100px;
float: right;
padding: 20px;
}
.photo img {
display: block;
width: 100%;
}
aside,
article {
float: left;
border: 1px solid #000;
height: 200px;
/* 固定高度可能導致內容溢出 */
padding: 10px;
}
/* 響應式設計 */
/* 適用於手機 */
@media screen and (max-width: 768px) {
.container {
width: 100%;
}
/* 您在 HTML 中沒有 .image 類別,這裡假設您指的是 .photo img */
.photo {
width: 100%;
/* 圖片容器佔滿螢幕寬度 */
float: none;
/* 在小螢幕上取消浮動,讓圖片獨佔一行或按流動排版 */
margin: 0 auto;
/* 居中圖片容器 */
}
.photo img {
width: 100%;
/* 圖片佔滿容器寬度 */
}
/* 調整 aside 和 article 的佈局,使其在小螢幕下堆疊顯示 */
aside,
article {
float: none;
/* 取消浮動 */
width: 100%;
/* 佔滿整行 */
height: auto;
/* 高度自動適應內容 */
margin-bottom: 20px;
/* 增加間距 */
}
/* 確保導覽列在手機上是水平滾動的,這部分已經在 nav ul 裡設定了,但可以再次確認或做微調 */
nav ul {
justify-content: flex-start;
/* 讓項目從左邊開始,更適合滾動 */
padding-left: 15px;
/* 給最左邊的項目一點空間,避免貼邊 */
padding-right: 15px;
/* 給最右邊的項目一點空間 */
}
}
/* 適用於平板 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
.container {
width: 90%;
/* 稍微增加寬度以利用平板空間 */
}
/* 假設 .image 再次指的是 .photo */
.photo {
width: 40%;
/* 平板上圖片寬度適中 */
float: right;
/* 保持浮動 */
}
.photo img {
width: 100%;
}
aside,
article {
/* 您原始代碼中這裡沒有 aside/article 的寬度設定,
如果它們需要並排,請設定寬度並考慮浮動或 flex */
/* 例如: */
/* width: 48%; */
}
}
/* 適用於桌機 */
@media screen and (min-width: 1025px) {
.container {
width: 960px;
/* 回歸到您的最大寬度 */
margin: 0 auto;
}
/* 假設 .image 再次指的是 .photo */
.photo {
width: 100px;
/* 桌面版圖片寬度 */
float: right;
/* 保持浮動 */
}
.photo img {
width: 100%;
}
/* 確保導覽列項目在大螢幕上可以居中顯示 */
nav ul {
justify-content: center;
/* 桌面版可以居中 */
padding-left: 0;
padding-right: 0;
}
}
.contact div {
height: fit-content;
width: fit-content;
}
table,
th,
td {
border: 1px solid black;
}
footer {
background-color: #2C3E50;
width: 100%;
color: #FFFFFF;
text-align: center;
/* 讓版權資訊居中 */
/*padding: 15px 0;*/
/* 增加底部空間 */
}
a {
color: blueviolet;
font-weight: normal;
transition: font-weight 0.3s ease;
/*為字變化添加過渡*/
}
a:hover {
color: aqua;
transform: scale(1.05);
/*放大5%*/
font-weight: bold;
}
/*li:hover {
color: #ff9900;*/
/* 變成亮橙色 */
/*cursor: pointer;*/
/* 同時讓鼠標變成手型,提示可互動 */
/*}*/
@keyframes typing {
from {
width: 0;
}
}
@keyframes caret {
50 % {
border-color: transparent;
}
}
.software {
font: bold 100% Consolas, Monaco, monospace;
width: 46ch;
white-space: nowrap;
display: inline-block;
overflow: hidden;
border-right: .05em solid white;
animation: typing 6s steps(46), caret 1s steps(1) infinite;
}
/* 針對 table 在小螢幕上的響應式調整 */
/* 讓表格在小螢幕上可以水平滾動 */
@media screen and (max-width: 768px) {
/* 包裹 table 的容器 */
.table-responsive {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 20px;
/* 增加間距 */
}
table {
width: 100%;
/* 確保表格可以填滿容器 */
border-collapse: collapse;
/* 移除雙邊框 */
min-width: 600px;
/* 設置一個最小寬度,以確保在小螢幕上仍能滾動顯示內容 */
}
th,
td {
white-space: nowrap;
/* 確保內容不換行,避免擠壓 */
padding: 10px;
/* 調整內邊距 */
}
/* 針對某些圖片可能過大的問題,尤其是 google_cloud/skill.jpg */
table img {
max-width: 100px;
/* 限制圖片最大寬度 */
height: auto;
display: block;
/* 避免圖片與文字基線對齊問題 */
}
}
.back-to-top-btn {
display: inline-block;
/* 讓它像區塊元素一樣可以設定寬高,但保持在行內 */
padding: 10px 20px;
background-color: rgb(255, 242, 2);
/* 藍色背景 */
color: white;
/* 白色文字 */
text-decoration: none;
/* 移除下劃線 */
border-radius: 5px;
/* 圓角 */
transition: background-color 0.3s ease;
/* 平滑過渡效果 */
}
.back-to-top-btn:hover {
background-color: #0056b3;
/* 鼠標懸停時顏色變深 */
}