The HTML4.01 specification states quite clearly:
Unlike
a
, [thelink
element] may only appear in thehead
section of a document...— HTML4.01 Specification - 12.3 Document relationships: the
link
element
It also goes on to say roughly the same thing about the meta
and style
elements.
However the HTML5 specification states:
A
body
element's start tag may be omitted if the element is empty, or if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is ameta
,link
,script
,style
, ortemplate
element.
It doesn't appear to go on to explain why the meta
, link
and style
elements are suddenly allowed to be contained within the body
element; especially not as the very first element.
It does give a couple of examples of usages with the style
and link
elements, but it doesn't explain them very well. For example, one example featuring the link
element it gives this:
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
<p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>
It doesn't explain why the link
element would be used here instead of a
- nor does the Microdata Working Group Note which appears to define the itemprop
attribute.
What's going on here? Why are these elements suddenly allowed within the body (and somewhat importantly as the first child)?