Responsive Mobile Menu with CSS

Size
2,796 Kb
Views
18,216

How do I make an responsive mobile menu with css?

Responsive mobile menu with css only. What is a responsive mobile menu with css? How do you make a responsive mobile menu with css? This script and codes were developed by Deyan Dimitrov on 21 October 2022, Friday.

Responsive Mobile Menu with CSS Previews

Responsive Mobile Menu with CSS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive Mobile Menu with CSS</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav class="mobile-menu">
<label for="show-menu" class="show-menu"><span>Menu</span><div class="lines"></div></label>	<input type="checkbox" id="show-menu">	<ul id="menu">	<li><a href="#">Home</a></li>	<li>	<a href="#">About</a>	</li>	<li>	<a href="#">Portfolio</a>	</li>	<li><a href="#">News</a></li>	<li><a href="#">Contact</a></li>	</ul>
</nav> <script src="js/index.js"></script>
</body>
</html>

Responsive Mobile Menu with CSS - Script Codes CSS Codes

*{ margin:0; padding:0;
}
body {	font-family: Helvetica, Arial, sans-serif; font-size:16px;
}
.mobile-menu { display:block; width:100%;
background: #8aa8bd/*e0b88f/*c99393/*e5d1a4/*dcc591/*EFD3A3*/;
line-height: 1.6em;
font-weight: 400;
width:100%;
text-align:center;	position: relative; margin:0 auto;
}
/*Strip the ul of padding and list styling*/
.mobile-menu ul {	list-style-type:none; margin: 0 auto; padding-left:0; text-align:center; width:100%; position: absolute; background: #8aa8bd;
}
/*Create a horizontal list with spacing*/
.mobile-menu li {	display:inline-block;	/*float: left;	margin-right: 1px;*/
}
/*Style for menu links*/
.mobile-menu li a {	display:block;	min-width:140px;	text-align: center;	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;	color: #fff; text-transform:uppercase;	background: #8aa8bd;	text-decoration: none; margin-left:-5px; padding: 10px 0;
-webkit-transition: all 0.4s ease 0s;
-moz-transition: all 0.4s ease 0s;
-ms-transition: all 0.4s ease 0s;
-o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s;
}
/*Hover state for top level links*/
.mobile-menu li:hover a {	color: #4db3ff; background-color:#ccddee;
}
/*Style for dropdown links*/
.mobile-menu li:hover ul a {	background: #f3f3f3;	color: #2f3036;	height: 40px;	line-height: 40px;
}
/*Hover state for dropdown links*/
.mobile-menu li:hover .mobile-menu ul a:hover {	color: #4db3ff;
}
/*Hide dropdown links until they are needed*/
.mobile-menu li ul {	display: none;
}
/*Make dropdown links vertical*/
.mobile-menu li ul li {	display: block;	float: none;
}
/*Prevent text wrapping*/
.mobile-menu li ul li a {	width: auto;	min-width: 100px;	padding: 0 20px;
}
/*Style 'show menu' label button and hide it by default*/
.mobile-menu .show-menu {	text-decoration: none;	color: #fff;	background: #8aa8bd;	text-align: center;	padding: 10px 15px;	display: none; cursor: pointer; text-transform: uppercase;
}
.mobile-menu .show-menu span{ padding-left: 35px;
}
/*Hide checkbox*/
.mobile-menu input[type=checkbox]{ display: none;
}
/*Show menu when invisible checkbox is checked*/
.mobile-menu input[type=checkbox]:checked ~ #menu{ display: block;
}
/*Responsive Styles*/
@media screen and (max-width : 800px){ .mobile-menu .lines { border-bottom: 15px double #f8f8f8; border-top: 5px solid #f8f8f8; content:""; height: 5px; width:20px; padding-right:15px; float: right;
}	/*Make dropdown links appear inline*/	.mobile-menu ul {	position: static;	display: none;	}	/*Create vertical spacing*/	.mobile-menu li {	margin-bottom: 1px;	}	/*Make all menu links full width*/	.mobile-menu ul li, .mobile-menu li a {	width: 100%;	}	/*Display 'show menu' link*/	.mobile-menu .show-menu {	display:block;	}
}

Responsive Mobile Menu with CSS - Script Codes JS Codes

//Resize the browser window to view the effect of responsive mobile menu
//original code is here: http://medialoot.com/blog/how-to-create-a-responsive-navigation-menu-using-only-css/
Responsive Mobile Menu with CSS - Script Codes
Responsive Mobile Menu with CSS - Script Codes
Home Page Home
Developer Deyan Dimitrov
Username deyand
Uploaded October 21, 2022
Rating 4
Size 2,796 Kb
Views 18,216
Do you need developer help for Responsive Mobile Menu with CSS?

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!

Deyan Dimitrov (deyand) Script Codes
Create amazing web content 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!