Hey,
Ik snap niet waarom mijn navbar niet fixed is. Weet jij wat ik verkeerd doe?
Welk forum is beter mijn vraag te stellen of staat Tweakers dit toe?
*snip* spam
Ik snap niet waarom mijn navbar niet fixed is. Weet jij wat ik verkeerd doe?
Welk forum is beter mijn vraag te stellen of staat Tweakers dit toe?
*snip* spam
HTML:
1
2
3
4
5
6
7
| <div id="navbar"> <a href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> </div> <div class="page-wrapper"> |
Cascading Stylesheet:
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
| #navbar { overflow: hidden; background-color: #333; } /* Navbar links */ #navbar a { float: left; display: block; color: #f2f2f2; text-align: center; padding: 14px; text-decoration: none; } /* Page content */ .content { padding: 16px; } /* The sticky class is added to the navbar with JS when it reaches its scroll position */ .sticky { position: fixed; top: 10; width: 100%; } /* Add some top padding to the page content to prevent sudden quick movement (as the navigation bar gets a new position at the top of the page (position:fixed and top:0) */ .sticky + .content { padding-top: 60px; |
[ Voor 2% gewijzigd door RobIII op 03-04-2020 21:20 . Reden: Spam verwijderd, code tags toegevoegd ]