Element link is missing required attribute property

前端 未结 6 1161
清歌不尽
清歌不尽 2020-12-12 23:47

...


        
6条回答
  •  清歌不尽
    2020-12-12 23:47

    The advice from @stevelove is apparently the practical solution, but here’s a theoretical answer to the “why” question:

    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 information in the error message is outdated, anyway. Error messages are apparently not updated as fast as the basic functionality of the validator.

提交回复
热议问题