Thursday, August 19, 2021

Html&CSS Navigation bar with icon

 Html&CSS Navigation bar with icon Code

<!DOCTYPE html>>

<html>


<head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" type="text/css" href="nav.css">

    <script src="https://use.fontawesome.com/d07a8c2f55.js"></script>

    <link rel="preconnect" href="https://fonts.gstatic.com">

    <title>web design</title>

</head>


<body>

  <nav>

      <ul>

          <li><a href="#"><i class="fa fa-home" aria-hidden="true"></i>Home</a></li>

          <li><a href="#"><i class="fa fa-book" aria-hidden="true"></i>Categories</a></li>

          <li><a href="#"><i class="fa fa-fire" aria-hidden="true"></i>Popular</a></li>

          <li><a href="#"><i class="fa fa-user" aria-hidden="true"></i>About-us</a></li>

          <li><a href="#"><i class="fa fa-envelope" aria-hidden="true"></i>Contact</a></li>


      </ul>

  </nav>

</body>

</html>

CSS STYLESHEET CODE

nav{

    background-color: black;

    overflow: hidden;

    

}

ul{

    list-style-type: none;

    padding:0px;

    margin-right: 15px;

}

li{

    float: left;

}

li a{

    display: block;

    color: #fff;

    text-align: center;

    padding:20px 15px;

    text-decoration: none;

}

li a:hover{

    background-color: white;

    color: #000;

}

No comments:

Post a Comment

JavaScript Animated

  JavaScript Animated <!DOCTYPE html> <html> <style> #myContainer {   width: 400px;   height: 400px;   position: relative;...