[html5] link fails validation

Ian Hickson ian at hixie.ch
Sat Jan 16 18:33:05 PST 2010


On Sat, 16 Jan 2010, designer wrote:
>
> If I insert a link as follows:
> 
> <link href="teststandard.css" rel="stylesheet" type="text/css">
> 
> The W3C HTML5 Conformance Checker fails and reports:  "Required 
> attributes missing on element link."
> 
> I've Googled this and not found anything about the syntax required. Is 
> this the checker that is wrong, or am I missing something?

Make sure you put the <link> before the <body>, and before any text that 
might imply a <body> -- for example, you'd see that error message for:

   <!DOCTYPE HTML>
   <title>Demo</title>
   X
   <link href="teststandard.css" rel="stylesheet" type="text/css">
   <p>...

...because the X implies a <body> (and a </head>) and so the <link> ends 
up in the wrong place.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list