Skip to content

Commit 306ae55

Browse files
KyleQ1calcmogul
authored andcommitted
Add sticky header
Also make header look stylish Closes #16
1 parent f2a6a91 commit 306ae55

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

main.css

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ code {
3636
div.body {
3737
margin: 2em auto;
3838
max-width: 38.75em;
39+
padding: 1em;
3940
}
4041

4142
figure figcaption {
@@ -67,15 +68,17 @@ pre {
6768

6869
#navbar {
6970
width: 100%;
70-
background-color: grey;
71+
background-color: darkblue;
7172
overflow: auto;
7273
margin: auto;
74+
position: fixed;
75+
top: 0;
7376
}
7477

7578
#navbar a {
7679
float: left;
77-
padding: 0.4em;
78-
color: black;
80+
padding: 0.4em 0.8em 0.4em 0.8em;
81+
color: white;
7982
text-decoration: none;
8083
font-size: 1em;
8184
}
@@ -85,12 +88,11 @@ pre {
8588
}
8689

8790
#navbar a:hover {
88-
background-color: grey;
89-
color: white;
91+
color: lightblue;
9092
}
9193

9294
#navbar ul li a.active {
93-
color: whitesmoke;
95+
color: lightslategray;
9496
}
9597

9698
@media screen and (max-width: 44em) {
@@ -99,3 +101,10 @@ pre {
99101
display: block;
100102
}
101103
}
104+
105+
:target::before {
106+
content: "";
107+
display: block;
108+
height: 2.8em; /* fixed header height */
109+
margin: -2.8em 0 0; /* negative fixed header height */
110+
}

0 commit comments

Comments
 (0)