Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

pure css drop down nav problem

Please look at my codepen at tell me what I'm doing wrong:

http://codepen.io/tbeckett24/pen/YPaVJN

Its meant to be a css drop down nav but I can't get the drop down to work. Please have a look if possible and give comment on my code as a whole if needed. I haven't got a clue why it son't work and it s so frustrating as I can get the rest set up fine.

1 Answer

Add the hover effect to the list item instead of the anchor, close the li tags of the submenu, display the list item of the main-menu as an inline-block instead floating them to the left.

can i just say a massive thank you for answering for me, I just couldn't work it out. If possible could you please explain why put the hove on the list item instead of anchor.

Again thanks alot its really appreciated.

can i just say a massive thank you for answering for me, I just couldn't work it out. If possible could you please explain why put the hove on the list item instead of anchor.

Again thanks alot its really appreciated.

When you add hover to the list item you're adding hover effect also to the sub-menu because it is part of the list item of the first menu, if you add hover to the anchor then if you hover an anchor inside the sub-menu then you're jumping to a different anchor.

Sorry for my english :D