- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello Sir,
I was making a nav bar and I noticed that in a drop-down menu I used to display the drop-down menu by hovering a like this:
http://codepen.io/majesticchirag/pen/NNKVOG?editors=1100#
however, that didn’t work out. So I checked some pens and found out that instead of hovering a, we hover li to display the drop-down menu… so I tried that. Here’s what I did:
http://codepen.io/majesticchirag/pen/ZWzNVy?editors=1100
And boom it worked now… How did this happen… What’s the difference between the two…?
You anchor tag (a) is not a parent of your div .sub_menu_people, whereas the li is.
So in your first example, the CSS declarations you’ve specified under a:hover .sub_menu_people doesn’t fire because there is no .sub_menu_people that is a child of an anchor tag.
Ok I got it! thanks for help…
I made some changes and this time and the content i wanted to display by hovering anchor tag was kept as a child of anchor tag but still it isnt working…
Nesting an UL inside an A is not proper markup.
I’ve forked you’re pen and changed the markup and some of the CSS.
Thanks !!!