22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.9.1 Specifying the stack <strong>level</strong>: the ’z-index’ property<br />

’z-index’<br />

Value: auto | | inherit<br />

Initial: auto<br />

Applies to: positioned elements<br />

Inherited: no<br />

Percentages: N/A<br />

Media: visual<br />

For a positioned box, the ’z-index’ property specifies:<br />

1. The stack <strong>level</strong> of the box in the current stacking context.<br />

2. Whether the box establishes a local stacking context.<br />

Values have the following meanings:<br />

<br />

This integer is the stack <strong>level</strong> of the generated box in the current stacking<br />

context. The box also establishes a local stacking context in which its stack<br />

<strong>level</strong> is ’0’.<br />

auto<br />

The stack <strong>level</strong> of the generated box in the current stacking context is the<br />

same as its parent’s box. The box does not establish a new local stacking<br />

context.<br />

In the following example, the stack <strong>level</strong>s of the boxes (named with their "id"<br />

attributes) are: "text2"=0, "image"=1, "text3"=2, and "text1"=3. The "text2" stack<br />

<strong>level</strong> is inherited from the root box. The others are specified with the ’z-index’<br />

property.<br />

<br />

<br />

<br />

Z-order positioning<br />

<br />

.pile {<br />

position: absolute;<br />

left: 2in;<br />

top: 2in;<br />

width: 3in;<br />

height: 3in;<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

This text will overlay the butterfly image.<br />

126

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!