Grace Sawyer Grace Sawyer - 5 months ago 34
CSS Question

How to Make Dropdown Menu li Vertically Listed

I can't find a way to make my header dropdown to be positioned the way I want it to. First off, the dropdown is horizontal, while it is supposed to stack up under each other. Second, the dropdown is not vertically aligned with the parent link, so I want it to be directly under its parent link and not a few pixels to the right of it. Using the left: __% only worked on one while totally pulling off track the other dropdown of a different parent, so it wasn't relative to the position of the parent of the dropdown.

Here is the jsfiddle:

I'm having trouble and I think I'm supposed to add the code here somewhere:

li ul {
display: none;
position: absolute;
top: 15%;
padding-left: 1px;


Answer Source

Your missing the class="sub" in <ul> sub menu.


Here is he full example of what you want:

Edit2: I think you don't need that z-index.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download