W3C home > Mailing lists > Public > www-style@w3.org > November 2005

Re: [css21] nested body elements (text/html)

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 03 Nov 2005 23:40:26 +0100
To: "Kelly Miller" <lightsolphoenix@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.szorxox564w2qv@id-c0020.oslo.opera.com>

On Thu, 03 Nov 2005 23:34:36 +0100, Kelly Miller  
<lightsolphoenix@gmail.com> wrote:
>> <http://annevankesteren.nl/test/css/legacy/001>
>
> That's some odd CSS,

Not really sure why the CSS is odd...


> but I BELIEVE that IE and Firefox have it right here (though I suspect  
> the line SHOULD have a green background, but since the document only has  
> one body element...).

No, it has two. One is added through the DOM and when you use the Firefox  
DOM inspector you can see it is there. When you check the DOM for Opera  
you get the same result.


>  When I looked at it in Opera (both 8.5 and 9 Beta), it filled the  
> background with green.  My guess is that means Opera is automatically  
> adding <html> and <body> or something?  I'm somewhat confused about this.

Ah, the HTML is confusing to you. Per the HTML specification most tags are  
optional and the elements are implicitly added based on certain rules. The  
DOM that is generated by browsers for the above mentioned document (on  
which the CSS is applied) looks like this (without text nodes and such):

HTML
  - HEAD
    - TITLE
    - STYLE
  - BODY
    - P
    - SCRIPT
    - BODY

So there are really two BODY elements there...

Kind regards,

Anne van Kesteren


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Thursday, 3 November 2005 22:40:44 GMT

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