DEV Community

Discussion on: Creating a fold out navigation with CSS only

Collapse
 
cydstumpel profile image
Cyd

Thank you!!! This is exactly what I was looking for. We might have to add border: none and background: none because for some weird reason checkboxes are really hard to make invisible in all browsers. I’m going to add this code en reference you in a bit!

Collapse
 
homer profile image
Homer Gaines • Edited

No prob :)

I made an update. I noticed the explicit label while associated with the labeled by was not triggering the mouse click. So I tied the label to the input using hamburger as the id and for. Also added cursor: pointer; to .nav__trigger-finger.


< nav class="nav">
< input
class="nav_trigger-input"
type="checkbox"
id="hamburger"
aria-label="click to open the navigation"
aria-labelledby="trigger"
/>
< label class="nav
_trigger-finger" id="trigger" for="hamburger">
< span>