Wie man erstellt: Obere Navigationsleiste
- Previous page Hover tab
- Next page Responsive top navigation
Lernen Sie, wie Sie eine obere Navigationsleiste mit CSS erstellen.
Obere Navigationsleiste
Erstellen Sie eine obere Navigationsleiste
Erster Schritt - HTML hinzufügen:
<div class="topnav"> <a class="active" href="#home">Startseite</a> <a href="#news">Nachrichten</a> <a href="#contact">Kontakt</a> <a href="#about">Über</a> </div>
Zweiter Schritt - CSS hinzufügen:
/* Schwarzen Hintergrund für die obere Navigationsleiste hinzufügen */ .topnav { background-color: #333; overflow: hidden; } /* Style für Links in der Navigationsleiste festlegen */ .topnav a { float: left; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; } /* Ändern Sie die Farbe der Links beim Mausüberfahren */ .topnav a:hover { background-color: #ddd; color: black; } /* Farbe für aktive/aktuelle Links hinzufügen */ .topnav a.active { background-color: #04AA6D; color: white; }
Related pages
Tutorial:How to create responsive top navigation
Tutorial:CSS navigation bar
- Previous page Hover tab
- Next page Responsive top navigation