Código HTML:
Ver original
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <header class="header_main"> <div class="headmenu"> <input type="checkbox" id="nav-toggle" class="nav-toggle"> </div> <nav class="nav"> <ul class="nav_list"> </ul> </nav> </div> </header> </body> </html>
y el css
Código CSS:
Ver original
body { background-color: #f4f4f4; } .nav { height: 100vh; width: 30%; max-width: 200px; position: absolute; top:0; left:-200px; background-color: white; } .nav li { list-style-type: none; display: block; text-align: center; line-height: 3; color:#000000; text-decoration: none; font-size: 12px; font-weight: bold; padding: 6px; } .nav-toggle { /*display: none;*/ } .nav-toggle-label::before { content: "☰"; } .nav-toggle:checked + .nav { left:0; } .headmenu { height: 45px; text-align: right; } .header_main { width: 340px; height: 488px; margin-right: auto; margin-left: auto; }