The regulations set by W3 state that <link>
tags should only be placed within the <head>
section:
Resources
For HTML 4.01: http://www.w3.org/TR/html401/struct/links.html#edef-LINK
For HTML5: http://www.w3.org/TR/html5/document-metadata.html#the-link-element
Verification Concerns: Updated October 27, 2017
In 2013, if a link
tag was included in the body
of an HTML document, it would not pass validation on validate.w3.org based on HTML 4.01 rules.
(Experiment with HTML 4.01 versus HTML 5.0 validation at )
Initially, the HTML 5.0 specification seemed to indicate that link
elements should only exist in the head
section. However, validation using an HTML 5.0 validator shows documents as acceptable even with a link
in flow content.
An explanation for this inconsistency could be found below.
Referring to the MDN documentation for the link
entry (MDN Link entry), it is revealed that if the link
element contains an itemprop
attribute, it can be placed in flow and phrasing content, including the body
.
This might clarify why HTML 5.0 validators do not raise any alerts even without the presence of the itemprop
attribute.
The itemprop
is linked to the microdata standard and is relatively recent (learn about HTML Microdata) making it worth exploring.
Currently, incorporating a link
to a stylesheet within the body
is possible, although the benefits are unclear.