Skip to content

Commit da38759

Browse files
committed
[css2] Updated z-index text and example
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401321
1 parent 33601fb commit da38759

1 file changed

Lines changed: 68 additions & 86 deletions

File tree

css2/visuren.src

Lines changed: 68 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: visuren.src,v 2.34 1998-03-21 21:23:08 ijacobs Exp $ -->
3+
<!-- $Id: visuren.src,v 2.35 1998-03-21 23:47:19 ijacobs Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Visual rendering model</TITLE>
@@ -1092,8 +1092,8 @@ with respect to a <A HREF="#containing-block">containing block</A>.
10921092
It also establishes a new containing block for descendant boxes.
10931093
However, the contents of an absolutely positioned element do not flow
10941094
around any other boxes. They may or may not obscure the contents of
1095-
another box, depending on the <a href="#z-order">z-order</a> of the
1096-
overlapping boxes.
1095+
another box, depending on the <a href="#stack-level">stack levels</a>
1096+
of the overlapping boxes.
10971097

10981098
<H3><a name="fixed-positioning">Fixed positioning</a></H3>
10991099

@@ -1472,54 +1472,48 @@ word.&lt;/P&gt;
14721472

14731473
<!-- How do you put the hyphens in the RIGHT margin? BB -->
14741474

1475-
<H2><a name="z-order">Z-order</a>: Layered presentation</H2>
1475+
<H2>Layered presentation</H2>
14761476
<P><em>In the following sections, the expression "in front of"
14771477
means closer to the user as the user faces the screen.</em></P>
14781478

1479-
<P>CSS2 allows authors to specify the position of a box along three
1480-
axes. In addition to their horizontal and vertical positions, boxes
1481-
lie along a "z-axis" and are rendered one on top of the other. Z-axis
1482-
positions are particularly relevant when boxes overlap visually.
1483-
1484-
<P>Each box belongs to a <span class="index-def" title="stacking
1485-
context"><dfn>stacking context</dfn></span>. Each box in a stacking
1486-
context has an integer <span class="index-def" title="stack
1487-
level"><dfn>stack level</dfn></span>. The stack level refers to its
1488-
position on the z-axis with respect to other boxes in the stacking
1489-
context.
1490-
1491-
<P>There is one <span class="index-def" title="global stacking
1492-
context"><dfn>global stacking context</dfn></span> to which all boxes
1493-
belong by default. In this stacking context, the root element of the
1494-
document tree generates a box with stack level '0', but other boxes
1495-
may have negative stack levels and will be rendered behind the root
1496-
element's box. Boxes with greater stack levels are always rendered in
1497-
front of boxes with lower stack levels.
1498-
1499-
<P>An element may establish a <span class="index-def" title="local
1500-
stacking context"><dfn>local stacking context</dfn></span> that is
1501-
inherited by its descendants (unless overridden). The box that
1502-
establishes the local stacking context has a stack level of '0' in
1503-
that context. However, the entire local stacking context has an
1504-
independent stack level within the surrounding stacking context. A
1505-
local stacking context is atomic; boxes in other stacking contexts may
1506-
not come between any of its boxes.
1507-
1508-
<P>The stack level of an element may be determined in two ways:</P>
1509-
1510-
<ul>
1511-
<li>Implicitly, by virtue of the element's position in the <a
1512-
href="conform.html#doctree">document tree</a>.
1513-
Boxes are stacked in the order their
1514-
source elements appear in the document tree: later boxes are
1515-
stacked in front of earlier boxes.
1516-
<li>Explicitly, via the <span
1517-
class="propinst-z-index">'z-index'</span> property.
1518-
</ul>
1519-
1520-
<!-- How do normal flow boxes stack? -IJ -->
1521-
1522-
<H3><a name="stack-level">Specifying the stack level</a>: the <span
1479+
<P>In CSS2, each box has a position in three dimensions. In addition
1480+
to their horizontal and vertical positions, boxes lie along a "z-axis"
1481+
and are rendered one on top of the other. Z-axis positions are
1482+
particularly relevant when boxes overlap visually. This section
1483+
discusses how boxes may be positioned along the z-axis in CSS2.
1484+
1485+
1486+
<P>Each box belongs to one <span class="index-def" title="stacking
1487+
context"><dfn>stacking context</dfn></span>. Each box in a given
1488+
stacking context has an integer <span class="index-def" title="stack
1489+
level"><a name="stack-level"><dfn>stack level</dfn></a></span>, which
1490+
is its position on the z-axis relative to other boxes in the same
1491+
stacking context. Boxes with greater stack levels are always rendered
1492+
in front of boxes with lower stack levels. Boxes may have negative
1493+
stack levels. Boxes with the same stack level in a stacking context
1494+
are stacked bottom-to-top according to document tree order.
1495+
1496+
<!-- Say depth-first traversal? -IJ -->
1497+
1498+
<P>The <a href="conform.html#root">root</a> element creates a <span
1499+
class="index-def" title="root stacking context"><dfn>root stacking
1500+
context</dfn></span>, but other elements may establish <span
1501+
class="index-def" title="local stacking context"><dfn>local stacking
1502+
contexts</dfn></span>. Stacking contexts are inherited. A local
1503+
stacking context is atomic; boxes in other stacking contexts may not
1504+
come between any of its boxes.
1505+
1506+
<P>An element that establishes a local stacking context generates a
1507+
box that has two stack levels: one for the stacking context it creates
1508+
(always '0') and one for the stacking context to which it belongs
1509+
(given by the <span class="propinst-z-index">'z-index'</span>
1510+
property).
1511+
1512+
<P>An element's box has the same stack level as its parent's box
1513+
unless given a different stack level with the <span
1514+
class="propinst-z-index">'z-index'</span> property.
1515+
1516+
<H3><a name="z-index">Specifying the stack level</a>: the <span
15231517
class="propinst-z-index">'z-index'</span> property</H3>
15241518

15251519
<!-- #include src=properties/z-index.srb -->
@@ -1529,54 +1523,38 @@ class="propinst-z-index">'z-index'</span> property specifies:
15291523

15301524
<ol>
15311525
<li>The stack level of the box in the current stacking context.
1532-
<li>Whether the box establishes a new local stacking context.
1526+
<li>Whether the box establishes a local stacking context.
15331527
</ol>
15341528

15351529
<P>Values have the following meanings:</p>
15361530

15371531
<dl>
1538-
<dt><strong>auto</strong>
1539-
<dd>The stack level of the generated box in the current stacking context
1540-
is given by the element's position in the document tree. The
1541-
box does not establish a new local stacking context.
15421532
<dt><span class="index-inst" title="&lt;integer&gt;"><span
15431533
class="value-inst-integer"><strong>&lt;integer&gt;</strong></span></span>
1544-
<dd>This value is the stack level of the generated box
1534+
<dd>This integer is the stack level of the generated box
15451535
in the current stacking context. The box
1546-
also establishes a new local stacking context.
1536+
also establishes a local stacking context in which its stack
1537+
level is '0'.
1538+
<dt><strong>auto</strong>
1539+
<dd>The stack level of the generated box in the current stacking
1540+
context is the same as its parent's box. The
1541+
box does not establish a new local stacking context.
15471542
</dl>
15481543

1549-
<P>The integer value of this property has the following meaning:</p>
1550-
1551-
<ul>
1552-
<li>Sibling boxes are stacked back-to-front in order of increasing
1553-
<span class="propinst-z-index">'z-index'</span> value. When two
1554-
siblings have the same <span
1555-
class="propinst-z-index">'z-index'</span> value, the later sibling
1556-
<!-- and its descendants -IJ --> generates boxes in front of those
1557-
generated by the earlier sibling.
1558-
1559-
<li>Elements with negative <span
1560-
class="propinst-z-index">'z-index'</span> values generate boxes
1561-
behind level 0 boxes in the current stacking context. Elements with
1562-
positive <span class="propinst-z-index">'z-index'</span> values
1563-
generate boxes in front of level 0 boxes in the current stacking context.
1564-
</ul>
1565-
1566-
<p>The relative z-order of two elements that are neither siblings
1567-
nor parent/child can be determined by evaluation of the previous
1568-
rules for both elements' ancestors. </p>
1569-
15701544
<div class="html-example"><P>
1571-
<P>In the following example, the order of the elements, listed
1572-
back-to-front is: "image", "text2", and "text1".
1545+
<P>In the following example, the stack levels of
1546+
the boxes (named with their "id" attributes) are:
1547+
"text2"=0, "image"=1, "text3"=2, and "text1"=3. The
1548+
"text2" stack level is inherited from the root box. The
1549+
others are specified with the <span
1550+
class="propinst-z-index">'z-index'</span> property.
15731551

15741552
<pre>
15751553
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
15761554
&lt;HTML&gt;
15771555
&lt;HEAD&gt;
15781556
&lt;TITLE&gt;Z-order positioning&lt;/TITLE&gt;
1579-
&lt;STYLE type=&quot;text/css&quot;&gt;
1557+
&lt;STYLE type="text/css"&gt;
15801558
.pile {
15811559
position: absolute;
15821560
left: 2in;
@@ -1588,17 +1566,21 @@ back-to-front is: "image", "text2", and "text1".
15881566
&lt;/HEAD&gt;
15891567
&lt;BODY&gt;
15901568
&lt;P&gt;
1591-
&lt;IMG alt="A butterfly image"
1592-
src=&quot;butterfly.gif&quot;
1593-
class=&quot;pile&quot;
1594-
id=&quot;image&quot;
1595-
style=&quot;z-index: 1&quot;&gt;
1569+
&lt;IMG id="image" class="pile"
1570+
src="butterfly.gif" alt="A butterfly image"
1571+
style="z-index: 1"&gt;
15961572

1597-
&lt;DIV class=&quot;pile&quot; id=&quot;text1&quot; style=&quot;z-index: 3&quot;&gt;
1573+
&lt;DIV id="text1" class="pile"
1574+
style="z-index: 3"&gt;
15981575
This text will overlay the butterfly image.
15991576
&lt;/DIV&gt;
16001577

1601-
&lt;DIV class=&quot;pile&quot; id=&quot;text2&quot; style=&quot;z-index: 2&quot;&gt;
1578+
&lt;DIV id="text2"&gt;
1579+
This text will be beneath everything.
1580+
&lt;/DIV&gt;
1581+
1582+
&lt;DIV id="text3" class="pile"
1583+
style="z-index: 2"&gt;
16021584
This text will underlay text1, but overlay the butterfly image
16031585
&lt;/DIV&gt;
16041586
&lt;/BODY&gt;

0 commit comments

Comments
 (0)