How to create a responsive menu bar or navigation bar in html & css || Programmer Hubs just for Programmer|| Rohit Sharma

 Today I Discuss about the website navigation bar or menu bar that is fully responsive with help of HTML and CSS . So topic is 

How to create a responsive menu bar or navigation bar in html & css || Programmer Hubs just for Programmer|| Rohit Sharma 


So firstly open your Editor (Notepad,Notepad++,VS Code etc)

first Design the HTML Page 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://kit.fontawesome.com/a076d05399.js"></script>
    <link rel="stylesheet" href="style.css">
  
</head>
<body>
    <nav>
        <input type="checkbox" id="check">
        <label for="check" class="checkbtn">
            <i class="fas fa-bars"></i>
        </label>
        <label class="logo">progarmmer Hub</label>
        <ul>
            <li><a href="#"  class="active">Home</a></li>
            <li><a href="#">Programming</a></li>
            <li><a href="#">Contact Us</a></li>
            <li><a href="#">About Us</a></li>

        </ul>
    </nav>
    <section>
        Rohit Sharmna</br>
        <br>
        <br>
    </section>
</body>
</html>
How to create a responsive menu bar or navigation bar in html & css  Programmer Hubs just for Programmer Rohit Sharma


After That Apply CSS Code :-
*{
    padding0;
    margin0;
    text-decorationnone;
    list-stylenone;
    box-sizingborder-box;
}
body{
    font-family: montserrat;

}
nav{
    background#0082e6;
    height80px;
    width100%;
}
label.logo{
    color:#fff;
    line-height80px;
    padding0 100px;
    font-size35px;
    font-weightbold;
    text-transformuppercase;
}
nav ul{
    floatright;
    margin-right20px;
}
nav ul li{
    displayinline-block;
    line-height80px;
    margin0 5px;
}
nav ul li a{
    color#fff;
    font-size17px;
    text-transformuppercase;
}
a.active ,a:hover{
    width:100%;
line-height70px;
border-radius5px;
background-color:#fff;
color#2c3e50;
.checkbtn{
    floatright;
    font-size:30px;
    color:#fff;
    line-height80px;
    margin-right40px;
    cursorpointer;
    displaynone;
}
#check{
    displaynone;
}
@media(max-width:952px)
{
    label.logo{
        font-size30px;
        padding-left50px;
    }
    nav ul li a{
        font-size16px;

    }
}
@media(max-width:858px)
{
    .checkbtn{
        displayblock;
    }
    ul{
        width100%;
        height100vh;
        positionfixed;
        background-color#2c3e50;
        top80px;
        left-100%;
        text-aligncenter;
        transition.5s;
    }
  nav  ul li{
        displayblock;
    }
    
}
#check:checked ~ul{
    left:0;
}

How to create a responsive menu bar or navigation bar in html & css  Programmer Hubs just for Programmer Rohit Sharma


How to create a responsive menu bar or navigation bar in html & css  Programmer Hubs just for Programmer Rohit Sharma

How to create a responsive menu bar or navigation bar in html & css  Programmer Hubs just for Programmer Rohit Sharma


THANKS GUYS........

Post a Comment

1 Comments

thanks for your suggestion and improving quality of the content