Skip to content

Commit 639b256

Browse files
committed
fix: use sticky property for header
1 parent 3296d29 commit 639b256

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

assets/css/main.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ body {
77
}
88

99
header {
10+
top: 0;
1011
margin: 0;
12+
position: sticky;
13+
width: 100%;
1114
padding: .75rem;
15+
box-sizing: border-box;
1216
border-bottom: 1px solid #ddd;
1317
background-color: hsla(0, 0%, 100%, .8);
1418
-webkit-backdrop-filter: saturate(110%) blur(5px);
1519
backdrop-filter: saturate(110%) blur(5px);
16-
position: fixed;
17-
width: 100%;
18-
top: 0;
1920
}
2021

2122
header ul {
@@ -59,7 +60,7 @@ header a {
5960

6061
main {
6162
max-width: 765px;
62-
margin: 3em auto;
63+
margin: auto;
6364
padding: 1em;
6465
}
6566

@@ -78,8 +79,7 @@ h1 {
7879
h2, h3, h4 {
7980
border-bottom: 1px solid darkorange;
8081
font-weight: normal;
81-
padding-top: 48px;
82-
margin-top: -24px;
82+
scroll-margin-top: 3em;
8383
}
8484

8585
time {

0 commit comments

Comments
 (0)