W3C home > Mailing lists > Public > www-validator@w3.org > March 2006

Re: Incorrect Validation of the External Stylesheet link

From: David Dorward <david@dorward.me.uk>
Date: Sat, 18 Mar 2006 15:19:01 +0000
To: Chris Eals <chriseals@gmail.com>
Cc: "www-validator@w3.org" <www-validator@w3.org>
Message-Id: <1142695141.19733.7.camel@cyberman.dorward.me.uk>

On Fri, 2006-03-17 at 10:55 +0000, Chris Eals wrote:
> Error Line 8 column 6: end tag for element "HEAD" which is not open..

> <link rel="stylesheet" type="text/css" href="WallStyles.css " />
> </head>

In HTML <foo /> is equivalent to <foo>&gt; (Although most browsers don't
respect this)[1].
Character data (i.e. text to be displayed) is not allowed in the <head>
section.
The end tag for the head element is optional.
The start tag for the body element is optional.
Thus putting character data in the head section implies the end of the
head section and the start of the body section.
This your code means the same as:

<link rel="stylesheet" type="text/css" href="WallStyles.css ">
</head>
<body>
&gt;
</head>

> Then it worked but this is incorrect according to the new rules of the
> code.

XHTML might be newer than HTML, but it doesn't change HTML. The rules
for HTML are still the same.

[1] http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.7
-- 
David Dorward                           <http://dorward.me.uk/>
"Anybody remotely interesting is mad, in some way or another."
                             -- The Greatest Show in the Galaxy
Received on Saturday, 18 March 2006 15:21:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:21 GMT