adc

clicks

how to create responsive navigation 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 menu bar</title>

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

</head>

<body>

               <div class="header">

                              <div class="navber">

                                             <ul>

                                                            <li>Home</li>

                                                            <li>Blog</li>

                                                            <li>Tutorial</li>

                                                            <li>Contact</li>

                                                            <li>About</li>

                                             </ul>

                              </div>

               </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.

*{

            margin:0;

            padding: 0;

            box-sizing: border-box;

}

body{

            width: 100%;

            height: 1000px;

            background-image: url(bg.jpg);

            background-size:cover;

}

.header{

            width: 100%;

            padding: 20px;

            position: fixed;

            top: 0px;

            transition: 0.5s;

            text-align: center;

}

 .header ul li{

            list-style-type: none;

            display: inline-block;

            padding: 10px 50px;

            color: white;

            font-size: 24px;

            font-family: sans-serif;

            cursor: pointer;

            border-radius: 10px;

}

.header ul li:hover{

            background-color: orange;

            color: black;

}

Source Code








how to create responsive navigation bar using html css how to create responsive navigation bar using html css Reviewed by easycoding on August 26, 2020 Rating: 5

No comments:

Powered by Blogger.