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


Z-index and positioning for dropdown CSS menu

I am trying to create a CSS-hover drop-down menu.

I was able to use z-index on the logo to have it appear outside of its parent div, but I am struggling to do the same with the drop-down menu.

I have turned off the hover property so it is easier to see what is going on - nested under "About" is a submenu that creates a scrollbar within the navigation div, rather than displaying on top of it.

.dropdown_1column { position:absolute; left:-1px; top: auto; z-index: 1000; }

I've also tried relative positioning, but then it pushes the main level li up above the others.


1 Answer

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Hi Daniel Leeman,

Perhaps you'll find this short video on creating a CSS Dropdown helpful. :)