- 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
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>>. Or rather <foo >> , where the final > is character data. > Character data (i.e. > 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> > > > <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