xhtml and the p tag

Chris Lilley chris at w3.org
Mon Mar 29 23:50:44 BST 1999



Daniel Austin wrote:
> 
> Mark,
> 
>         This has not changed from HTML 4.0.

Or 3.2 or 2.0

> All of your paragraphs in XHTML
> documents should be enclosed with <p>...</p>
> element delimiters. 

Yes. Explicitly.

In theory, they were enclodsed in them implicitly with HTML <=4.0
through the magic of SGML omissible end tags. In practice, though,
browsers did not correctly infer missing end tags (or indeed omitted
start tags) thus leading to the well known disparities in HTML "parsing"
which became abundantly obvious with the rise in use of CSS and DOM
(both of which require a parse tree, preferable the correct parse tree).

> Since the <p> element is itself a block level element,
> it cannot itself contain any block level elements.

Like body, ul, ol, dl and div ? These are block level elements and can
contain other block level elements.

> The construction <p/> has to my knowledge never been acceptable markup in
> either HTML or XHTML documents.

True. 

In an XML document instance which used HTML element names, <p/> would be
quite fine for an empty paragraph, in a well formed document.

XHTML warns agains using it only if you are trying to fool existing HTML
browsers into accepting your XML as if it were HTML.

--
Chris

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list