With heaps of people working on hamburger menus I thought I'd put this little piece together with some examples at the bottom.
Essentially with hamburger menus you have 3 options:
-
You can use the
:hover
psuedoclass, the menu isdisplay:none
until you hover on the icon, the menu needs to be a child of the hamburger, downside of this technique is that:hover
doesn't work on touch screen devices -
You can use the 'fake checkbox' technique which Aaron told me about yesterday, this requires a bit more setup but have a look at the code that I've posted below, it works on touch screens
-
JavaScript
onclick
which is by far the easiest approach, works on all devices, but we'll get to JavaScript in about 6 weeks 🤪!