Mobile app version of vmapp.org
Login or Join
YK1175434

: 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)

@YK1175434

Posted in: #Html #Html5 #Microdata

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @YK1175434

2 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

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

10% popularity Vote Up Vote Down


 

@Megan663

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme