Navbar using Flex Property


 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>navbar</title>
    <style>
        *{
            box-sizing: border-box;
            margin: 0px;
            padding: 0px;
        }
        nav{
            width: 100%;
            background-color: #222;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            margin: 0px 0px 0px 0px ;
            border-radius: 0px;
        }
        nav h2{
            color: #fff;
        }
        nav ul{
            display: flex;
            justify-content: center;
            align-items: center;
        }
        nav ul li{
            list-style: none;
            padding: 0px 5px;
        }
        nav ul li a{
            color: #fff;
            font-size: 15px;
            text-decoration: none;
            padding: 20px;
        }
        nav ul li a:hover{
            color: gray;
        }
    </style>
</head>
<body>
    <nav>
        <h2>Logo</h2>
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">Info</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">About Us</a></li>
        </ul>
    </nav>
</body>
</html>

Comments

Popular posts from this blog