: Can I change the type of elements in the Microdata format? With regard to Microdata I was wondering if the elements must be exactly like the examples (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035)
With regard to Microdata I was wondering if the elements must be exactly like the examples (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035) or that Google/Bing look if the itemprop attributes occur on certain elements.
For example, could I replace this:
<div itemprop="name">some text</div>
with this:
<span itemprop="name">some text</span>
without affecting its functionality?
More posts by @YK1175434
2 Comments
Sorted by latest first Latest Oldest Best
Yes, you may use any HTML5 element for Microdata.
Bute note that some elements come with special rules:
elements with href/src attribute (e.g., a, link, img, etc.) create a URI as value
the time element creates a datetime as value
All other elements create a string as value. This is usually the element’s content, but in some cases it’s the value of an attribute:
for meta elements: the value of the content attribute
for data and meter elements: the value of the value attribute
The type of tag can be either div or span without changing how micro-data is extracted. Here is a site giving examples with itemprop on a span tag: www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
The best way to know for sure that Google will accept your markup, is to test it with the Google Structured Data Tool.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.