Header Ads

Navbar design with hover so easy using CSS

 

Source Code:


Html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Navbar</title>
    <link rel="stylesheet" href="style.css">
    <nav>
        <div class="logo">Always Nope</div>
        <ul>
            <li><a href="">Home</a></li>
            <li><a href="">About</a></li>
            <li><a href="">Contact</a></li>
        </ul>
    </nav>
</head>
<body>
   
</body>
</html>

CSS:

*{
    padding: 0;
    margin: 0;
}
nav{
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    background-color: yellow;
    text-align: center;
}
.logo{
    font-size: 25px;
    color: #000;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
nav ul{
    display: flex;
}
nav ul li{
    list-style: none;
    padding: 10px 20px;
    cursor: pointer;
}
nav ul li a{
    font-size: 20px;
    color: black;
    text-decoration: none;
    font-family: sans-serif;
}
nav ul li:hover{
    background-color: white;
    border-radius: 5px;
}
Powered by Blogger.