z-index in css code example
Example 1: css z index
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
The z-index property specifies the stack order of an element.
Example 2: css z-index
z-index: auto;
z-index: 0;
z-index: 3;
z-index: 289;
z-index: -1;
z-index: inherit;
z-index: initial;
z-index: unset;
Example 3: css z-index
#nav {
position: fixed;
...
z-index: 2;
}
#main {
position: absolute;
...
z-index: 1;
}
Example 4: default z index
the default z-index is 0.
Example 5: z-index
z-index: 1;