W3C home > Mailing lists > Public > www-style@w3.org > July 2002

z-index

From: Sigurd Lerstad <sigler@bredband.no>
Date: Fri, 19 Jul 2002 04:32:25 -0700
Message-ID: <05e801c22f17$f4a4ceb0$481273d5@mmstudioproj>
To: <www-style@w3.org>

Hello,

I'm not sure I understand how the z-index works.

In this example:

<style type="text/css">
      em {
 position: absolute;
 left: 100px;
 top:100px;
 z-index: auto;
      }
</style>

<body>

<p>
First <em>Absolute</em> First
</p>

<p>
Second paragraph
</p>

</body>

In all tested browers, the <em>Absolute</em> overlaps the text in the second
paragraph, okay.. the two paragraphs each create a block box.

The <em> in the first paragraph, doesn't it create a box that is a child of
the first paragraph?  I thought that the z-index specified in what order to
draw sibling elements, but apparently it doesn't? And if you treat the
box-model as a tree of boxes and you draw all boxes recursively? and if <em>
is a child of the first <p> then the <em> wouldn't overlap the second <p>..
Can someone explain to me the relationship between the boxmodel and the
z-index property? I've read "CSS2 9.9 Layered presentation" and I still
don't understand it.

thanks,

--
Sigurd Lerstad
Received on Thursday, 18 July 2002 22:31:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT