Toggle Function with CSS
I implemented the toggle functionality of the navbar using vanilla CSSunknown
css
a year ago
553 B
2
Indexable
nav .nav-bar { width: 480px; } nav .menu { flex-direction: column; align-items: center; justify-content: center; width: 80%; height: 100%; position: fixed; top: 0; right: -100%; z-index: 100; background: #010a1b; } nav .menu li { margin: 20px 0; } nav .menu li a { color: #fff; font-size: 22px; font-weight: bold; padding: 10px; text-transform: uppercase; } nav .open-menu, nav .menu .close-menu { display: block; } #check:checked ~ .menu { right: 0; }
Editor is loading...