W3C home > Mailing lists > Public > www-style@w3.org > August 1999

Re: Q: z-index and the body element

From: Tantek Celik <tantek@cs.stanford.edu>
Date: Sun, 29 Aug 1999 20:17:00 -0700
To: Ian Hickson <py8ieh=www-style@bath.ac.uk>, Axel Dahmen <a.dahmen@infozoom.de>
CC: "'www-style@w3.org'" <www-style@w3.org>, Bert Bos <Bert.Bos@sophia.inria.fr>
Message-ID: <1276139483-214231903@psdbay.com>
>> I've got a question regarding the z-index property: Why can I still see
>> elements which I've put *behind* the BODY element (see example below)?
>
> Because your browser has a bug or doesn't support z-index.

Or the browser *doesn't* have a bug and is properly ignoring z-index on
non-positioned elements.

>> <BODY STYLE="z-index: 0; background-color: #456789;">
>> <P STYLE="z-index: -1; color: #fedcba;">This is a test showing a text that
>> shouldn't be visible as it lies behind the body element <EM>("z-index"
>> property equals "-1").</EM>
>> </BODY>

In the example given, both elements which have a z-index *do not* have their
position property set, and since according to:

 http://www.w3.org/TR/REC-CSS2/visuren.html#z-index

the z-index property "Applies to: positioned elements", the settings on the
z-index property are ignored.

Tantek
Received on Sunday, 29 August 1999 23:17:31 GMT

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