Hoe te maken: horizontaal schuifbaar menu
- Previous page Sidebar with icons
- Next page Vertical menu
Leer hoe je een horizontaal schuifbaar menu maakt met CSS.
Hoe een horizontaal schuifbaar menu te maken
Stap 1 - Voeg HTML toe:
div.class="scrollmenu"> <a href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> <a href="#about">About</a> ... </div>
Stap 2 - Voeg CSS toe:
De truc om een navigatiemenu schuifbaar te maken is het gebruik van overflow:auto en white-space:nowrap:
div.scrollmenu { background-color: #333; overflow: auto; white-space: nowrap; } div.scrollmenu a { display: inline-block; color: white; text-align: center; padding: 14px; text-decoration: none; } div.scrollmenu a:hover { background-color: #777; }
Related pages
Tutorial:CSS navigation bar
- Previous page Sidebar with icons
- Next page Vertical menu