jviotti
jviotti

Reputation: 18939

CSS relative positioned text

I have a navigation bar with dropdowns on hovering. Just at the bottom of it, I have a relative positioned text. When hovering triggers on the navbar, the dropdown menu comes down, but instead of hiding the relative text, the text still shows above the dropdown.

I know I could trigger a hide() with jquery when hovering, but is there a pure CSS approach?

Upvotes: 0

Views: 70

Answers (1)

Zach Lysobey
Zach Lysobey

Reputation: 15744

Positioned elements' (relative, absolute, and fixed) stacking order is set with z-index.

Set z-index: 10 for the nav bar, and z-index: 5 for the text.

Of course these numbers (5,10) are arbitrary, the important thing being that 5 < 10

Upvotes: 1

Related Questions