Skip to content

Commit 7a22a9e

Browse files
committed
refactor: 改用 rem 單位取代寫死的像素值,提升響應式設計
1 parent 78b0124 commit 7a22a9e

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta http-equiv="Expires" content="0">
99
<meta name="theme-color" content="#000000">
1010
<title>GitHub Copilot 教學專案</title>
11-
<link rel="stylesheet" href="style.css?v=20250603010">
11+
<link rel="stylesheet" href="style.css?v=20250603011">
1212
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
1313
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script>
1414
</head>
@@ -352,6 +352,6 @@ <h3 style="font-size: 1.25rem; font-weight: 600; color: #1d1d1f; margin-bottom:
352352
</div>
353353
</div>
354354

355-
<script src="script.js?v=20250603010"></script>
355+
<script src="script.js?v=20250603011"></script>
356356
</body>
357357
</html>

style.css

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -661,16 +661,15 @@ body {
661661

662662
.markdown-close {
663663
position: sticky;
664-
top: 20px;
664+
top: 1rem;
665665
float: right;
666-
margin-top: -20px;
667-
margin-right: -20px;
668-
margin-bottom: 20px;
669-
width: 36px;
670-
height: 36px;
666+
clear: both;
667+
margin: -1.5rem -1.5rem 1.5rem auto;
668+
width: 2.25rem;
669+
height: 2.25rem;
671670
cursor: pointer;
672671
background: rgba(60, 60, 67, 0.95);
673-
border-radius: 18px;
672+
border-radius: 50%;
674673
display: flex;
675674
align-items: center;
676675
justify-content: center;
@@ -688,10 +687,10 @@ body {
688687
.markdown-close::after {
689688
content: '';
690689
position: absolute;
691-
width: 14px;
692-
height: 1.5px;
690+
width: 0.875rem;
691+
height: 0.125rem;
693692
background: white;
694-
border-radius: 2px;
693+
border-radius: 1px;
695694
}
696695

697696
.markdown-close::before {
@@ -719,12 +718,10 @@ body {
719718

720719
@media (max-width: 768px) {
721720
.markdown-close {
722-
top: 15px;
723-
margin-top: -10px;
724-
margin-right: -10px;
725-
width: 32px;
726-
height: 32px;
727-
border-radius: 16px;
721+
top: 0.75rem;
722+
margin: -0.75rem -0.75rem 1rem auto;
723+
width: 2rem;
724+
height: 2rem;
728725
}
729726

730727
.markdown-content {

0 commit comments

Comments
 (0)