Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Responsive Menu css in MyBB by WallBB
/*
Tutorial by WallBB
http://wallbb.co.uk
*/
.toggle, [id^="drop"] {
display: none;
}
nav {
background: #333;
margin: 0;
padding: 0;
}
nav::after {
clear: both;
content: "";
display: table;
}
nav ul {
list-style: outside none none;
margin: 0;
padding: 0;
position: relative;
}
nav ul li {
border-left: 1px solid #555;
display: inline-block;
float: left;
margin: 0;
}
nav a {
background: #222;
color: #fff;
display: block;
font-family: Helvetica,Arial,Verdana,sans-serif;
font-size: 12px;
padding: 10px 15px;
text-decoration: none;
}
nav ul li ul li:hover {
background: #444 none repeat scroll 0 0;
}
nav a:hover {
background-color: #000000;
}
nav ul ul {
display: none;
position: absolute;
top: 35px;
}
nav ul li:hover > ul {
display: inherit;
}
nav ul ul li {
display: list-item;
float: none;
position: relative;
width: 170px;
}
nav ul ul ul li {
left: 170px;
position: relative;
top: -60px;
}
nav ul li > a::after {
content: " ";
display: inline;
font-family: fontawesome;
}
nav ul li > a:only-child::after {
content: "";
}
@media all and (max-width: 768px) {
nav {
margin: 0;
}
.toggle + a, .menu {
display: none;
}
.toggle {
background: #333;
border: medium none;
color: #ffffff;
display: block;
font-family: Helvetica,Arial,Verdana,sans-serif;
font-size: 12px;
padding: 10px 15px;
text-decoration: none;
}
.toggle:hover {
background-color: #000000;
}
[id^="drop"]:checked + ul {
display: block;
}
nav ul li {
display: block;
width: 100%;
}
nav ul ul .toggle, nav ul ul a {
padding: 0 40px;
}
nav ul ul ul a {
padding: 0 80px;
}
nav a:hover, nav ul ul ul a {
background-color: #000000;
}
nav ul li ul li .toggle, nav ul ul a, nav ul ul ul a {
color: #ffffff;
font-size: 12px;
padding: 10px 15px;
}
nav ul li ul li .toggle, nav ul ul a {
background-color: #212121;
}
nav ul ul {
color: #ffffff;
float: none;
position: static;
}
nav ul ul li:hover > ul, nav ul li:hover > ul {
display: none;
}
nav ul ul li {
display: block;
width: 100%;
}
nav ul ul ul li {
position: static;
}
}
@media all and (max-width: 330px) {
nav ul li {
display: block;
width: 94%;
}
}
@media only screen and (min-width: 769px) {
nav ul {
margin-left: 8%;
}
nav ul ul {
margin-left: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.