Sådan oprettes: Bundmenu
- Previous page Vertical menu
- Next page Responsive bottom navigation
Lær, hvordan du bruger CSS til at oprette en bundmenu.
Opret bundmenu
Trin 1 - Tilføj HTML:
<div class="navbar"> <a href="#home" class="active">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> </div>
Trin 2 - Tilføj CSS:
/* Placer navigationsfeltet i bunden af siden og gør det fast */ .navbar { background-color: #333; overflow: hidden; position: fixed; bottom: 0; width: 100%; } /* Angiv stil for links i navigationsfeltet */ .navbar a { float: left; display: block; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; } /* Ændr farve på link, når musen hovers over det */ .navbar a:hover { background-color: #ddd; color: black; } /* Tilføj farve til aktiv/aktuel link */ .navbar a.active { background-color: #04AA6D; color: white; }
Related pages
Tutorial:CSS navigation bar
- Previous page Vertical menu
- Next page Responsive bottom navigation