+ 1
What is z index
7 Antworten
+ 3
It determines the stacking order of positioned elements on a web page.
It is used to control how elements are layered and displayed on top of each other along the z-axis, which represents the depth or "third dimension" of the page.
+ 3
Sandeep
Bigger nummber in z-index -> the element displays less deep in the foreground
Lower number in z-index -> the element goes to the background
+ 3
https://developer.mozilla.org/
is always a good reference
I always think of it like layers in Photoshop. Bigger numbers are on top of smaller ones. Negatives move elements behind.
https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
+ 2
In your CSS, change this line to:
.special {
z-index: 3;
Then run your code. I think you'll understand, once you see the difference.
+ 2
Ok
+ 1
When z index is 3 the 2 elements goes on 1and 3
+ 1
It defines how elements are overlayed, elements with larger z-index will project on top of all those with a smaller z-index