W3C home > Mailing lists > Public > www-validator@w3.org > February 2005

Re: body tag problem

From: Lachlan Hunt <lachlan.hunt@iinet.net.au>
Date: Fri, 11 Feb 2005 13:55:23 +1100
Message-ID: <420C1E9B.70703@iinet.net.au>
To: tedd <tedd@sperling.com>
CC: www-validator@w3.org

tedd wrote:
> One can create a page that does not have an open <body> tag, but does 
> have a close </body> tag and the page will validate. I assume that this 
> is a bug.
> 
>    http://www.webbytedd.com/body.html

It's not a bug.  In HTML, the start and end tags for the body element 
are optional, as defined in the DTD, and you may include none, either or 
both and still validate.

<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->

The same is also true for the html, head and tbody elements.  Several 
others have required start tags with optional end tags, and others 
require both.  This does not apply to XHTML documents.

-- 
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/    Rediscover the Web
http://SpreadFirefox.com/   Igniting the Web
Received on Friday, 11 February 2005 02:55:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT