Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html validation error for property attribute

I am using few facebook social plugins and I am using the meta header. When validating the page, the W3C validator is throwing the error -> "Error: there is no attribute "property".

I am using the XHTML Transitional doctype - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Pls Suggest if I have to change the doctype to something else.

like image 821
Castor Avatar asked Apr 24 '10 15:04

Castor


People also ask

How do you show validation error in HTML?

Show activity on this post. You can now use the HTMLFormElement. reportValidity() method, at the moment it's implemented in most browsers except Internet Explorer (see Browser compatibility at MDN). It reports validity errors without triggering the submit event and they are shown in the same way.

How do you validate a field in HTML?

To validate the form using HTML, we will use HTML <input> required attribute. The <input> required attribute is a Boolean attribute that is used to specify the input element must be filled out before submitting the Form.

Which are the correct input restrictions used for validation purpose in HTML5?

INPUT type="number" and type="range" The number and range input types also accept parameters for min, max and step. In most cases you can leave out step as it defaults to 1. As with other HTML5 input types, browsers that don't recognise the new options will default to simple text inputs.


1 Answers

Facebook's plugins use Open Graph, which is built on RDFa. It's RDFa that adds the property attribute to elements. Without this addition, plain HTML has no such attribute. (If you ask me, it's a strange design to add a new attribute without namespacing it, and to re-use half of a <meta> tag. But no-one did.)

To validate XHTML-with-RDFa, you'll need the DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> 

This means you will have to be writing valid XHTML 1.1. More

like image 53
bobince Avatar answered Oct 01 '22 20:10

bobince