April 2013
Intermediate to advanced
264 pages
7h 44m
English
HTML5 has addressed the semantic issue with the creation of a simple syntax called microdata. This is essentially a series of name-value pairs that provide meaningful machine-readable data. As always, before trying to explain it, showing you how it works is easier:
<p itemscope>I live in <span itemprop="city">London</span></p>
This markup creates a single item. The attribute itemscope is used on the containing element to mark the limits, or scope, of this particular item. Inside we have the name-value pair, known as a property: The value of the itemprop attribute is the name—which, in this example, is city—and the element’s content is the value—in this case, London. The result is an item with a single property:
city: 'London'
But you’re ...
Read now
Unlock full access