How to fix: There is no attribute "property"

Most Likely Cause and Fix

Your HTML4 or XHTML markup makes use of a HTML5 meta element with a property attribute of the form:

<meta property="…" content="…" />

This most commonly occurs when using Facebook Open Graph properties or Facebook app, page or admin identifiers such as:

<meta property="fb:app_id" content="123456789012" />
<meta property="fb:page_id" content="98765432109" />
<meta property="fb:admins" content="123456789,987654321"/>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Example Widgets" />
<meta property="og:image" content="" />
<meta property="og:title" content="Example Widgets of the Day" />
<meta property="og:description" content="See today's hottest Widgets!"/>
<meta property="og:url" content="" />

You must use HTML5 to use meta elements with the property attribute.

Check the document type declaration used in your markup. Fix this if not correct.

What This Error Means

There is a defined set of attributes for each HTML element. You may choose to omit some but you cannot choose to add further attributes beyond those defined.

This error is simply saying that the attribute property cannot be used where you used it.

How To Fix It

Check your doctype

Make sure you're using the version of HTML you intended to use.

If you are transitioning from an older to a newer version of HTML, check that the attributes you are using are still valid.

The use of some attributes may become deprecated over time if they're found to not be as useful as intended. Some attributes may be removed entirely.

Check the document type declaration used in your markup. Fix this if not correct.

If you are using HTML5 custom data attributes of the form data-*, make sure you are using the HTML5 doctype: <!DOCTYPE html>,.

Simply remove the attribute

You have used the attribute property on an element where the element does not allow an attibute of that name.

The specific error message you encountered will refer to a line and column number. This will guide you to the exact point in your markup to which the error relates.

You should remove this attribute for your markup to be valid.

Use a HTML5 custom data attribute

Are you making up attributes merely as a means of storing data?

Whilst the following is invalid HTML, the invalid attributes could still end up in the DOM and be accessible via JavaScript:

<img src="" alt="Desc" property="jon" />

HTML5 custom data attributes are intended exactly for this purpose. Give it a go if relevant to you.

<img src="" alt="Desc" data-property="jon" />

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus