Visit Mozilla.org

CSS:z-index

From MDC

« CSS Reference

[edit] Summary

The z-index property specifies the z-order of an element and its descendants. When elements overlap, z-order determines which one covers the other. An element with a larger z-index generally covers an element with a lower one.

[edit] Syntax

z-index: auto | <integer> | inherit

[edit] Values

auto 
The element is drawn at the same z-order as an element with z-index: 0. It does not create a new stacking context.
<integer> 
The element is drawn at the z-order given. It also creates a new stacking context, which means that all of its descendants also draw at that z-index. This means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element.

[edit] Examples

[edit] Notes

Negative z-index values are supported correctly starting in Gecko 1.9 / Firefox 3. Previous versions implemented the CSS 2 behavior, not the CSS 2.1 behavior that is compatible with other browsers.

[edit] Specifications

[edit] Browser compatibility

[edit] See also

position