Search within TutorialsPark

CSS Z-index Property


To set the front-to-back order for positioned elements


Definition and Notes.

1. The CSS z-index property is used specify the layering of positioned elements.It can be applied only to elements for which the position property is set to absolute , relative or fixed .

2. The value for z-index is a number and negative values are allowed as well, elements with higher stacking order are positioned above the elements with lower stacking order.


Syntax:

CSS z-index property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note-The z-index property is not inherited by child elements

Property Values

Value Description
<integer> An integer denotes the stacking order of the objects
auto The stacking-order of the child element is same as parent element.
inherit The child element inherits the stacking order of the parent element.

Specifications

Specs Value
Name z-index
Value <integer> | auto | inherit
Initial Value auto
Applies to Positioned Elements
Javascript syntax object.style.zIndex="5"
Inherited No
Computed Value Same as declared Value
Browser Support internetexplorer safari firefox opera chrome


Related Examples.