Mobile navigation bar

Developer
Size
2,549 Kb
Views
10,120

How do I make an mobile navigation bar?

Hamburger . What is a mobile navigation bar? How do you make a mobile navigation bar? This script and codes were developed by Mihkel on 08 December 2022, Thursday.

Mobile navigation bar Previews

Mobile navigation bar - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Mobile navigation bar</title> <meta charset="UTF-8"
<meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav> <span class="hamburger">&#x2261;</span> <ul class="menu"> <li class="mockups"> <a href="#"> Mockups <span class="caret"></span> </a> <ul class="dropdown mockups-dropdown"> <li><a href="#">Premium Mockups</a></li> <li><a href="#">Free mockups</a></li> <li><a href="#">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet sapiente officia minima. Sint doloribus aliquam fugit deleniti? Consectetur praesentium perspiciatis quas amet ex atque officiis!</a></li> </ul> </li><!-- --><li><a href="#">Bundles</a></li><!-- --><li class="categories"> <a href="#"> Categories <span class="caret"></span> </a> <ul class="dropdown categories-dropdown"> <li><a href="#">Appareal</a></li> <li><a href="#">Books</a></li> <li><a href="#">Devices</a></li> <li><a href="#">Displays</a></li> <li><a href="#">Editorial</a></li> <li><a href="#">Glassware</a></li> <li><a href="#">Magazine</a></li> <li><a href="#">Packaging</a></li> <li><a href="#">Print Advertising</a></li> <li><a href="#">Stationary</a></li> </ul> </li><!-- --><li><a href="#">Blog</a></li> </ul>
</nav> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Mobile navigation bar - Script Codes CSS Codes

body {	margin: 0;	background-color: #ccc;	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
nav {	background-color: #fafafa;	width: 100%;
}
ul {	padding: 0;	margin: 0;	list-style: none;
}
li {	display: inline-block;
}
a,
.hamburger {	font-weight: 400;	font-size: 18px;	padding: 12px 15px;	text-decoration: none;	color: #383838;	display: block;
}
a:hover {	color: #858585;
}
.mockups,
.categories {	position: relative;
}
.dropdown {	position: absolute;	background-color: #fafafa;	width: 150%;	left: 0;	box-shadow: 0 2px 4px rgba(0,0,0,0.4);	z-index: 1;
}
.dropdown a {	font-weight: 100;	/*font-size: 16px;*/	padding: 5px 15px;
}
.caret {	display: inline-block;	width: 0;	height: 0;	margin-left: 2px;	vertical-align: middle;	border-top: 4px dashed;	border-top: 4px solid \9;	border-right: 4px solid transparent;	border-left: 4px solid transparent;
}
.mockups-dropdown,
.categories-dropdown,
.hamburger {	display: none;
}
.hamburger {	cursor: pointer;
}
.mockups:hover > .mockups-dropdown,
.categories:hover > .categories-dropdown,
.dropdown li {	display: block;
}
@media all and (max-width: 768px) {	.dropdown {	width: 70%;	left: 10%;	}	.menu {	display: none;	}	.menu > li {	display: block;	}	.hamburger {	display: inline-block;	}
}
@media all and (min-width: 769px) {	.menu {	display: block !important;	}
}

Mobile navigation bar - Script Codes JS Codes

$(document).ready(function () { $(".hamburger").on("click", function () { $(".menu").slideToggle(); });
});
Mobile navigation bar - Script Codes
Mobile navigation bar - Script Codes
Home Page Home
Developer Mihkel
Username Krokodill
Uploaded December 08, 2022
Rating 3
Size 2,549 Kb
Views 10,120
Do you need developer help for Mobile navigation bar?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Mihkel (Krokodill) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!