Z-Index Attribute

HTML (DHTML)

Z-Index Attribute

Internet Development Index

Determines the display order of overlapping shapes. Read/write String.

Applies To

Shape

Tag Syntax

<v:element style="z-index: expression">

Script Syntax

element.style.zindex="expression"

expression=element.style.zindex

Remarks

The Z-Index attribute is similar to the standard HTML Z-Index attribute for styles.

Values include:

Value Description
Auto The order that the shapes appear in the HTML page will be used, bottom to top.
order A number that represents the stacking precedence. A shape with a a higher number will be displayed as if it were overlapping (in "front" of) a shape with a lower number. Negative numbers can be used.

VML Standard Attribute

Example

The red shape will be displayed in "front" of the blue shape, because it has a higher z-index.

   <v:rect id=bluerect fillcolor="blue"
   style="position:relative;top:1;left:1;width:20;height:20;z-index:1">
   </v:rect>
   <v:rect id=redrect fillcolor="red"    style="position:relative;top:10;left:10;width:20;height:20;z-index:2">    </v:rect>

Z-Index Attribute Example. (Requires Microsoft Internet Explorer 5 or greater.)