style.zIndex (Property)

A value for the position of the element in a Z stacking order.


CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Opera - 5.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.zIndex
-myStyle.zIndex = aZValue
CSS syntax:z-index: aZValue
Argument list:aZValueA position in the z order

Elements can be placed in front of or behind other elements according to the Z index value.

The value should be defined with an integer or can be replaced by the auto keyword. The auto value is the same as setting this property to zero.

Any elements that share the same zIndex value will be stacked in the display using their order as presented in the document source.


See also:Layer.zIndex, style.textShadow, style.zOrder