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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Document Window<br />

I used two red hyphens to serve<br />

as a change bar. They will "float"<br />

to the left of the line containing<br />

−−THIS word.<br />

First, the paragraph (whose containing block sides are shown in the illustration)<br />

is flowed normally. Then it is offset ’10px’ from the left edge of the containing<br />

block (thus, a right margin of ’10px’ has been reserved in anticipation of the<br />

offset). The two hyphens acting as change bars are taken out of the flow and<br />

positioned at the current line (due to ’top: auto’), ’-1em’ from the left edge of its<br />

containing block (established by the P in its final position). The result is that the<br />

change bars seem to "float" to the left of the current line.<br />

9.9 Layered presentation<br />

In the following sections, the expression "in front of" means closer to the user as<br />

the user faces the screen.<br />

In <strong>CSS2</strong>, each box has a position in three dimensions. In addition to their horizontal<br />

and vertical positions, boxes lie along a "z-axis" and are formatted one on<br />

top of the other. Z-axis positions are particularly relevant when boxes overlap<br />

visually. This section discusses how boxes may be positioned along the z-axis.<br />

Each box belongs to one stacking context. Each box in a given stacking<br />

context has an integer stack <strong>level</strong>, which is its position on the z-axis relative to<br />

other boxes in the same stacking context. Boxes with greater stack <strong>level</strong>s are<br />

always formatted in front of boxes with lower stack <strong>level</strong>s. Boxes may have negative<br />

stack <strong>level</strong>s. Boxes with the same stack <strong>level</strong> in a stacking context are<br />

stacked bottom-to-top according to document tree order.<br />

The root [p. 30] element creates a root stacking context, but other elements<br />

may establish local stacking contexts. Stacking contexts are inherited. A local<br />

stacking context is atomic; boxes in other stacking contexts may not come<br />

between any of its boxes.<br />

An element that establishes a local stacking context generates a box that has<br />

two stack <strong>level</strong>s: one for the stacking context it creates (always ’0’) and one for<br />

the stacking context to which it belongs (given by the ’z-index’ property).<br />

An element’s box has the same stack <strong>level</strong> as its parent’s box unless given a<br />

different stack <strong>level</strong> with the ’z-index’ property.<br />

125

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

Saved successfully!

Ooh no, something went wrong!