You can use the technique of having a label attached to a field checkbox
to control when the menu will be opened/closed, in that other answer I gave an example and explained a little better.
In your case, just leave the menu in absolute position and keep it "hidden" by setting its position on the left with a negative value, which will make it exit the field of view of what the user is seeing. And when the checkbox is selected, just reset the distance from the menu on the left.
Left p/ right
*{ margin:0; box-sizing: border-box }
nav {
border: 1px solid #333;
display: flex;
flex-flow: column wrap;
left: -110%; /* para escondê-lo */
position: absolute;
transition: left 400ms ease-in;
width: 100%
}
#menu { display: none }
#menu:checked + nav {
left: 0 /* para exibi-lo */
}
<label for='menu'>Menu</label>
<input id='menu' type='checkbox'/>
<nav>
<a href='#!'>Link 1</a>
<a href='#!'>Link 2</a>
<a href='#!'>Link 3</a>
<a href='#!'>Link 4</a>
<nav>
Right p/ left
*{ margin:0; box-sizing: border-box; overflow: hidden }
nav {
border: 1px solid #333;
display: flex;
flex-flow: column wrap;
right: -100%; /* para escondê-lo */
position: absolute;
transition: right 400ms ease-in;
width: 100%
}
#menu { display: none }
#menu:checked + nav {
right: 0 /* para exibi-lo */
}
<label for='menu'>Menu</label>
<input id='menu' type='checkbox'/>
<nav>
<a href='#!'>Link 1</a>
<a href='#!'>Link 2</a>
<a href='#!'>Link 3</a>
<a href='#!'>Link 4</a>
<nav>
Is that how you want it? -> http://jsfiddle.net/h1twygcx/
– Sergio
If you could want with CSS3?
– Tiago P.C
@Tiagop. C I suggested an edit removing the Javascript tag, since you’re saying you don’t want Javascript solutions.
– Pablo Almeida
@Tiagop. C my code is with CSS3 :)
– Sergio