The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Navigation bar using :target – any ideas?
I’m trying to make navigation bar appear on click using :target.
http://cdpn.io/wmFdB
Would it be possible to make h2 (“Navigation”) disappear once clicked on?
:target affects browser history. I guess there’s no way to prevent it with just CSS, right?
Obviously a javascript solution is required.
https://css-tricks.com/on-target/
For me the issue is the user experience.
How do users collapse the menu again?
It seems that http://cdpn.io/fCydm doesn’t work due to https://css-tricks.com/webkit-sibling-bug/. I think I’ve managed to get it work now: http://cdpn.io/cAyLo. This one works both in Android, Dolphin and Opera Mini browsers.