<h1>Menu | Nav </h1>
<nav id="navigation">
<input type="checkbox" id="toggle-nav">
<label for="toggle-nav" onclick><span>Menu</span>
</label>
<ul>
<li><a href="#">Najma</a>
</li>
<li><a href="#">Najma</a>
</li>
<li><a href="#">Najma</a>
</li>
<li><a href="#">Najma</a>
</li>
<li><a href="#">Riesling</a>
</li>
<li><a href="#">Najma</a>
</li>
</ul>
</nav>
/* www.najmacode.com */
* {
box-sizing: border-box;
}
/* Responsive Navigation styles begin here */
nav > input,
nav > label {
display: none;
/* hidden on large screens */
}
@media (max-width: 767px) {
/* Theming opened nav */
nav ul {
/* translate with hardware acceleration */
transform: translateZ(0);
-webkit-transition: max-height .4s, overflow .4s;
transition: max-height .4s, overflow .4s;
will-change: max-height, overflow;
/* global styles */
margin: 0;
padding: 0;
list-style: none;
}
nav a {
display: block;
padding: 1.2rem;
color: #333;
background: #fff;
text-decoration: none;
margin-bottom: 2px;
}
nav a:hover,
nav a:focus,
nav a:active {
background: #eee;
}
/* handling clic with CSS3 checked */
/* Theming closed nav */
nav > input:not(:checked) ~ ul {
max-height: 0;
overflow: hidden;
}
/* Theming opened nav */
nav > input:checked ~ ul {
max-height: 20em;
overflow: visible;
}
/* Global styling nav button */
nav > label {
display: block;
position: absolute;
top: 1rem;
right: 1rem;
z-index: 1;
height: 4.5rem;
width: 4.5rem;
background: #333;
border: 0;
border-radius: 50%;
text-align: center;
font-size: 10px;
line-height: 1.6;
color: #fff;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-transition: .2s -webkit-transform cubic-bezier(0, 1.8, 1, 1.2);
transition: .2s transform cubic-bezier(0, 1.8, 1, 1.2);
}
nav > label:before {
content: "";
display: block;
z-index: 1;
height: 1.6rem;
width: 2rem;
background-color: transparent;
background-image: -webkit-gradient(linear, left top, right top, from(#fff), to(#fff)), -webkit-gradient(linear, left top, right top, from(#fff), to(#fff)), -webkit-gradient(linear, left top, right top, from(#fff), to(#fff));
background-image: -webkit-linear-gradient(left, #fff, #fff), -webkit-linear-gradient(left, #fff, #fff), -webkit-linear-gradient(left, #fff, #fff);
background-image: linear-gradient(to right, #fff, #fff), linear-gradient(to right, #fff, #fff), linear-gradient(to right, #fff, #fff);
background-position: center top, center, center bottom;
background-repeat: no-repeat;
-webkit-background-size: 2rem .3rem;
background-size: 2rem .3rem;
margin: .8em auto 0;
padding: 0;
outline: 0;
border: 0;
cursor: pointer;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-transition: .2s cubic-bezier(0, 1.8, 1, 1.2);
transition: .2s cubic-bezier(0, 1.8, 1, 1.2);
transition-property: background;
}
/* Theming opened nav button */
nav > input:checked + label {
-webkit-transform: scale(.8);
transform: scale(.8);
}
nav > input:checked + label::before {
background-position: center, center, center;
}
/* Hide alternate text except from screen readers */
.visually-hidden {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
overflow: hidden;
height: 1px;
width: 1px;
}
}
/* BONUS deco */
/* Global deco */
html {
font-size: 62.5%;
}
body {
margin: 0;
padding: 1rem;
background: #e3e3e3;
color: #000;
font-family: helvetica, arial, sans-serif;
font-size: 1.3em;
line-height: 1.5;
}
section {
position: relative;
margin-top: 1rem;
;
padding: 1rem;
background: #fff;
}
h1,
h2 {
margin-top: 0;
margin-bottom: 1rem;
color: #345;
text-shadow: 1px 1px 1px #fff;
}
h1 {
font-size: 2.4rem;
}
h2 {
margin-top: 2rem;
}
a {
color: #345
}
ul {
padding-left: 1em;
list-style-position: inside
}
section li {
list-style: none;
}
section li::before {
content: "\2713 ";
margin-right: .8rem;
}
/* orientation */
@media (orientation: landscape) and (max-device-width: 767px) {
html,
body {
-webkit-text-size-adjust: 100%;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.