adc

clicks

How to Make Responsive Navigation Menu Bar using HTML & CSS

 


HTML
Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.
After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.


<!DOCTYPE html>
<html>
<head>
            <title>NAVIGRATION BAR</title>
            <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
            <div class="wrapper">
                        <nav>
                                    <div class="logo">LOGO</div>
                                    <ul>
                                                <li><a class="active" href="#">Home</a></li>
                                                <li><a href="#">Blog</a></li>
                                                <li><a href="#">News</a></li>
                                                <li><a href="#">Demo</a></li>
                                                <li><a href="#">Contact</a></li>
                                                <li><a href="#">About</a></li>
                                    </ul>
                        </nav>
            </div>
</body>
</html>          

CSS 

Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.


body{
            margin: 0;
            padding: 0;
            font-family: arial;
            background-image: url(bg.jpg);
            background-size: cover;
            background-position: center;
            width: 100%;
            height: 100vh;
}
 
nav{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100px;
            padding: 10px 90px;
            box-sizing: border-box;
            background: rgba(0,0,0,0.5);
}
 
.logo{
            padding: 22px 20px;
            height: 80px;
            float:left;
            font-size: 24px;
            font-weight: bold;
            text-transform: uppercase;
            color: white;
}
ul{
            list-style: none;
            float: right;
            margin:0;
            padding: 0;
            display: flex;
}
 
a{
            line-height: 80px;
            color: #fff;
            padding: 12px 30px;
            text-decoration: none;
            text-transform: uppercase;
            font-size: 15px;
            font-weight: bold;
}
 
a:hover{
            background: rgba(0,0,0,0.7);
            border-radius: 6px;
}
 
a.active{
            background: #e2472f;
            color:white;
            border-radius: 6px;
}









How to Make Responsive Navigation Menu Bar using HTML & CSS How to Make Responsive Navigation Menu Bar using HTML & CSS Reviewed by easycoding on August 29, 2020 Rating: 5

No comments:

Powered by Blogger.