user606521
user606521

Reputation: 15434

nested ul positioned absolute under parent li

Here is html+css: http://jsfiddle.net/xgXXN/

I want to orange (parent li) appear OVER green (nested ul). The green ul HAS TO be positioned absolutely because I don't want it to stretch parent li.

I can't find solution to this :(. The best would be just css modification not HTML if it's possible.

Upvotes: 0

Views: 676

Answers (2)

Michael Raffaele
Michael Raffaele

Reputation: 132

Issue you are having is because you are applying the z-index to the li which is then also applying through to the child list of this li.

Try setting position:relative and z-index to the anchor instead.

http://jsfiddle.net/N62x8/

Upvotes: 1

Adam Sznajder
Adam Sznajder

Reputation: 9206

I hope that this is what you are looking for:

ul.main-menu > li > ul {
    position:absolute;
    padding-top: 5px;
}

Upvotes: 0

Related Questions