Help with responsive navbar menu

https://codepen.io/griffnsh-the-vuer/pen/qBzrxoG Trying to get good with mobile first and toying around at work since it's slow today. Took me a min to get show-menu to get added to the menu from my JS and after I finally got that working now the active menu background doesn't seem to hit the same height that my nav items should be creating, I'm sure it's something really dumb I'm missing but wanted to see what y'all think
No description
3 Replies
Chris Bolson
Chris Bolson3mo ago
There are a few things here but your first issue is that you have given the ul list of menu items a position: absolute;. By doing that you are basically extracting the menu items list from their parent (the hidden nav) so it has nothing to base it's height on other than the padding that you have given it. As a side note, the hamburger should really be a "button" element as it has user interaction with an event. You shouldn't add eventlisteners to divs, at least not for important user interaction.
damn
damn3mo ago
so can I know what was the problem actually
griff
griff3mo ago
Huge thanks for pointing that out and also helping me out with the semantics!
Want results from more Discord servers?
Add your server