- From: David Dorward <david@dorward.me.uk>
- Date: Mon, 18 Oct 2004 16:32:54 +0100
- To: Pim Blokland <pblokland@planet.nl>
- Cc: www-validator@w3.org
On Mon, Oct 18, 2004 at 02:10:31PM +0200, Pim Blokland wrote: > I've read all about it, and now I'm even less sure than before. > 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)? The short answers are that "It is wrong to use XHTML style self-closing tags in HTML" and that "The Validator is correct". The long answer is that it may or may not be *valid* depending on where you use it. In HTML <foo /> (effectively) means the same as <foo>>. Character data (i.e. > or 'Hello, world') is not allowed within the <head>. However, the end tag for head and the start tag for body are optional. So this is valid: <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> The only browser I know that might respect this is Emacs w3-mode, so its very badly supported and something you probably wouldn't want to do anyway. -- David Dorward http://dorward.me.uk
Received on Monday, 18 October 2004 15:32:57 UTC