Rectangle 27 0

html Element link is missing required attribute property?


Although a link element is unconditionally invalid in body in older HTML specifications, HTML5 has more permissive rules. According to HTML 5.1 Nightly (which is more or less what the validator tries to keep up with), the link element is allowed in the document body, too (wherever phrasing content is allowed), provided that it has an itemprop attribute. This seems to make the error message even more puzzling. Part of the explanation is that the validator is actually validating against HTML5 + RDFa, and RDFa defines the property attribute. The problem still remains what specific RDFa definition the validator is checking against, since the definition would need to redefine rules for HTML, too.

The advice from @stevelove is apparently the practical solution, but heres a theoretical answer to the why question:

The information in the error message is outdated, anyway. Error messages are apparently not updated as fast as the basic functionality of the validator.

This error message is NOT present anymore as of 2017.

This error message is still present as of 2016

Note
Rectangle 27 0

html Element link is missing required attribute property?


@stevelove (one year later/for future reference) That's not often optimized. In the best of all possible worlds, you should put critical above-the-fold css in <style> at the top of the document and put the rest at the bottom. This is the best way to open a page faster. You can find docs on the web about this BUT it's not always possible to do it (and often, business code's efficiency > performance).

Validation aside, you should always put stylesheets at the top of the document to avoid blocking the rest of the page from rendering, as described here: developer.yahoo.com/performance/rules.html#css_top

Note
Rectangle 27 0

html Element link is missing required attribute property?


The HTML spec itself does also say that the link element is allowed in the body if it has an itemprop attributebut only if the link element doesn't have a rel value. (itemprop is Microdata attribute whose purpose is basically the same as the RDFa property attribute).

And while the HTML spec itself says link is normally not allowed in the body, the RDFa spec says that if a link element has a property attribute, it is allowed in the body.

So that validator message is basically saying,The link element is only allowed here if it has a property attribute. But this particular link element doesn't have a property attribute.

So we have two different attributes that both independently affect where in a document the link element is allowed to appear, and that complicates the checking logic in the validator in a way that makes it difficult to emit a better, more helpful error message for this case.

W3C HTML5 validator maintainer here. As pointed out in another answer, in addition to checking requirements in the HTML5 spec itself, the validator also checks against requirements in the HTML+RDFa 1.1 spec:

Note
Rectangle 27 0

html Element link is missing required attribute property?


<link rel='stylesheet' property='stylesheet' id='basecss-css'  href='http://www.someurl.com/modules/14ce1e21/peadig-eucookie.css' type='text/css' media='all' />
property='stylesheet'

Add

if you do not want to move your link to the <head> of the document.

Note