Responsive Mobile Menu with CSS
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 - 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/
Developer | Deyan Dimitrov |
Username | deyand |
Uploaded | October 21, 2022 |
Rating | 4 |
Size | 2,796 Kb |
Views | 18,216 |
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!
Name | Size |
Sliding side menu with icons | 2,357 Kb |
404 error bad TV page | 2,243 Kb |
Fixed header jquery | 3,367 Kb |
Dropdown Menu Effects | 3,565 Kb |
Responsive Mobile Menu | 3,267 Kb |
Expandable Menu | 3,006 Kb |
Fullpage.js testing | 2,483 Kb |
Sliding link on hover | 1,986 Kb |
Mobile Dropdown Menu | 4,204 Kb |
Dropdown Menu on Image Click with Zoom | 2,639 Kb |
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!
Name | Username | Size |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Mega menu | DimaZubkov | 5,066 Kb |
HTML5 Breakout | Jaysalvat | 4,873 Kb |
Commuter Line Tokyu 8500 | Pedox | 7,031 Kb |
Menu | Vivi_Lai | 1,210 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
My three.js practice | Esambino | 3,203 Kb |
Hexagons | Ashmind | 4,360 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
IPhone5S SVG Space Grey | Onlinechris | 75,035 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!