W3C home > Mailing lists > Public > www-html@w3.org > December 2005

Re: HTML Improvement/Suggestion

From: Sebastian Redl <sebastian.redl@getdesigned.at>
Date: Mon, 12 Dec 2005 11:01:56 +0100
Message-ID: <439D4A94.3050806@getdesigned.at>
To: www-html@w3.org

Anne van Kesteren wrote:

> DTDs are ingored, but did you ever play with XML (or XHTML) as opposed 
> to HTML?
> You can do all funny things you want to do. Like nesting <div> inside 
> <span> et
> cetera.

Define "can".

In XML, elements are arbitrary and have no meaning. You can nest 
whatever you want in everything else, and the document will be well-formed.
But specific XML languages, such as XHTML, go beyond that and define the 
document structure. A non-validating parser will accept a div inside a 
span for XHTML, but it is invalid according to the standard and all 
schemas, and a validating parser will reject it.
The same in HTML: it's invalid, but browsers will accept it because 
they're very forgiving. However, the results of this, especially the 
display behaviour of showing a block element inside an inline element, 
are undefined. You can't rely on a behaviour.

Sebastian Redl
Received on Monday, 12 December 2005 10:01:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:12 UTC