Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS z-index definition

Browser support
IEFFOpSaf

Type:

Syntax

z-index: <value>

Description

z-index is a css-property that can be used to place an element "behind" another element. It sets the stack order of an element, and an element with a higher value of z-index will be placed above an element with a lower stack order. The z-index property can have negative values.

Note that z-index only works on elements that have been positioned with style "position:absolute".

Version information

Thie property is available since CSS 2.0.

Example

[Try this example yourself]
<p><img src="http://www.glubase.com/images/glubase2.gif" alt="" style="position: absolute; left: 0px; top: 0px; z-index: -1;" /></p>
<p>Default z-index is 0. Z-index -1 has lower priority.</p>

Output

Default z-index is 0. Z-index -1 has lower priority.

  • Comments

No comments added.