Professional Documents
Culture Documents
Side Navigation Menu Bar in HTML CSS & JavaScript
Side Navigation Menu Bar in HTML CSS & JavaScript
Side Navigation Menu Bar in HTML CSS & JavaScript
DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
</head>
<body>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#gallery">Gallery</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#feedback">Feedback</a></li>
</ul>
<section>
<i class="fas fa-bars"></i>
<div class="sec1"></div>
<h2 id="about">
About Section
</h2>
<p>
</p>
<div class="sec2"></div>
<h2 id="portfolio">
Portfolio Section
</h2>
<p>
<div class="sec3"></div>
<h2 id="gallery">
Gallery Section
</h2>
<p>
</p>
<div class="sec4"></div>
<h2 id="services">
Services Section
</h2>
<p>
<div class="sec5"></div>
<h2 id="feedback">
Feedback Section
</h2>
<p>
</p>
<div class="sec6"></div>
<h2 id="contact">
Contact Section
</h2>
<p>
<div class="sec7"></div>
</section>
<script>
$(document).ready(function(){
$('i').click(function(){
$('ul').toggleClass('ul_show');
$('section').toggleClass('slide_image');
});
$('li').click(function(){
$(this).addClass('active').siblings().removeClass('active');
});
});
</script>
</body>
</html>
*{
padding: 0;
margin: 0;
text-decoration: none;
list-style: none;
box-sizing: border-box;
html{
scroll-behavior: smooth;
body{
font-family: montserrat;
ul{
position: fixed;
top: 0;
left: 0;
margin-left: -240px;
width: 240px;
background: #1e1e1e;
height: 100vh;
overflow-y: auto;
ul li{
height: 65px;
outline: none;
ul li a{
display: block;
height: 100%;
width: 100%;
line-height: 70px;
font-size: 20px;
color: white;
padding-left: 10%;
background: #1e1e1e;
li a.contact{
.active a{
color: #B93632;
background: #1B1B1B;
section{
margin-left: 0px;
i{
position: fixed;
font-size: 40px;
color: orangered;
cursor: pointer;
.sec1{
margin-left: -20px;
background-size: cover;
height: 100vh;
}
.sec2{
margin-left: -20px;
background-size: cover;
height: 100vh;
.sec3{
margin-left: -20px;
background-size: cover;
height: 100vh;
.sec4{
margin-left: -20px;
background-size: cover;
height: 100vh;
.sec5{
margin-left: -20px;
height: 100vh;
.sec6{
margin-left: -20px;
background-size: cover;
height: 100vh;
.sec7{
margin-left: -20px;
background-size: cover;
height: 100vh;
h2{
font-size: 40px;
p{
text-align: justify;
}
.ul_show{
margin-left: 0px;
.slide_image{
margin-left: 260px;