I am working on a website and at this problem I got stuck I have created a navigation bar and applied fixed position property in css, but below it, I have created an hover element but this hover display above the navigation bar. Here are some screenshots:)
Asked
Active
Viewed 398 times
-1
-
Does this answer your question? [All About.... Z-Index?](https://stackoverflow.com/questions/2305669/all-about-z-index) – Christian Sep 01 '22 at 18:44
3 Answers
0
Set the z-index of the navigation bar large enough to always be larger than the hovering element, even when it's hovering.

Kevin K Varughese
- 306
- 1
- 6
0
Make the z-index of the navigation greater than the z-index of the hover element in css.
nav {
z-index: 2
}
hoverElement {
z-index: -1
}

Muhammad Tayyab
- 110
- 6