33 Votes

HTML5 Validator: Element "link" is missing required attribute "property"

Question by Compi | Last update on 2023-03-23 | Created on 2016-02-21

After I have switched my website to HTML 5, a new error message is displayed when trying to validate the page. Obviously, this was not a problem in HTML 4.

Error: Element "link" is missing required attribute "property".

Apparently, that error is about one of my CSS stylesheets I have included into my webpage in the following way.

<link href="style.css" rel="stylesheet" type="text/css">

Interestingly, this error only appears when I have declared the stylesheet within the Body of the HTML page. The error disappears when adding the sheet in the Head. However, different Pagespeed and Analyzing Tools are telling me that I should better declare the CSS within the Body as I have done.

What should the attribute "property" be? I have never heard about that before.

ReplyPositiveNegative
2Best Answer4 Votes

This error always appears when trying to put an element of the type "link" into the body of an HTML page.

There are two ways how you can fix the problem:

  • Put your CSS-Stylesheet into the Head of your page
  • Leave your Stylesheet within the Body and add property="stylesheet" to it

If your decision is the second possibility, your declaration should look like that:

<link href="style.css" rel="stylesheet" property="stylesheet" type="text/css">

The HTML Validator says that the link-element is only allowed in the body in case that it contains the property-attribute.
Last update on 2023-03-23 | Created on 2016-02-22

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.