May 06, 2021 CSS Reference Manual
The z-index property specifies the stacking order of an element.
Elements with a higher stack order are always in front of elements with a lower stack order.
Note: z-index locates elements (position:absolute, position:relative, or position:fixed).
Default: | auto |
---|---|
Inherited: | no |
Version: | CSS2 |
JavaScript syntax: | object .style.zIndex="1" |
Value | Describe |
---|---|
auto | Default. The stacking order is equal to that of the parent element. |
number | Set the stacking order of the elements. |
inherit | Specifies that the value of the z-index property should be inherited from the parent element. |
The numbers in the table support the first browser version number of the property.
Attributes | |||||
---|---|---|---|---|---|
z-index | 1.0 | 4.0 | 3.0 | 1.0 | 4.0 |
Set the z-index of the image:
CSS tutorial: CSS Positioning