Hoe - Onderste rand Nav Links
Leer hoe u navigatielinks met onderrand (onderstreping) kunt maken met CSS.
Onderste rand navigatielinks
Een navigatiemenu maken
Stap 1) HTML toevoegen:
Voorbeeld
<div class="topnav">
<a href="#home"
class="active">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
</div>
Stap 2) CSS toevoegen:
Voorbeeld
/*
Add a black background color to the top navigation */
.topnav {
background-color: #333;
overflow: hidden;
}
/*
Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
border-bottom: 3px solid transparent;
}
.topnav a:hover {
border-bottom: 3px solid red;
}
.topnav
a.active {
border-bottom: 3px solid red;
}
Tip: om mobielvriendelijke, responsieve navigatiebalken te maken, leest u onze How To - Responsive Top Navigation- tutorial.
Tip: Ga naar onze CSS Navbar-zelfstudie voor meer informatie over navigatiebalken.