W3C home > Mailing lists > Public > www-validator@w3.org > October 2004

Re: Too much info on auto-closing META tags - confusing

From: Nick Kew <nick@webthing.com>
Date: Mon, 18 Oct 2004 19:02:48 +0100 (BST)
To: David Dorward <david@dorward.me.uk>
Cc: Pim Blokland <pblokland@planet.nl>, www-validator@w3.org
Message-ID: <Pine.LNX.4.53.0410181857200.2396@hugin.webthing.com>

On Mon, 18 Oct 2004, David Dorward wrote:

[warning: pedantry follows]
> > My question is: are auto-closing META tags like this
> >
> > <meta name="x" content="x" />
> >
> > valid HTML 4.01 strict (even if the W3 validator says they aren't)?

No, that's invalid.

> The long answer is that it may or may not be *valid* depending on
> where you use it.

He said HTML strict.  The remainder of your reply applies to legacy,
not to strict.

> In HTML <foo /> (effectively) means the same as <foo>&gt;.

Or rather <foo >> , where the final > is character data.

> Character data (i.e. &gt; or 'Hello, world') is not allowed within the
> <head>.

Nor in <body> (in strict).  It has to go inside an appropriate container.

> However, the end tag for head and the start tag for body are optional.
> So this is valid:

HTML-loose yes; strict no.
> <title>Foo</title>
> <meta name="x" content="x" />
> <h1>Wibble</h1>
> as it means the same as
> <head>
> <title>Foo</title>
> <meta name="x" content="x">
> </head><body>
> &gt;
> <h1>Wibble</h1>

More pedantry: that's not equivalent even in loose.  You introduced
whitespace at the top of the <body>.

> The only browser I know that might respect this is Emacs w3-mode, so

I expect an SGML browser would too, but I seem to have mislaid my QWeb:-)

Nick Kew
Received on Monday, 18 October 2004 18:03:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:43 UTC