.hamburger
stays with my top bar which is hidden if I change the z-index, how do I stop this from happening?
Assuming you want the topbar to be hidden when the menu is open, and have the hamburger appear on top of the menu while it is open.
Use css visibility: hidden
on your #heading
, and set visibility: visible
on your .hamburger
, don't change z-indexes.
I have updated your fiddle with an example
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.