Schema.org give a div a itemprop="image"?

Wayne's World picture Wayne's World · Aug 8, 2013 · Viewed 28.4k times · Source

I am replacing an image with a <div> with background-image for the reason of background-size: cover; The page is structured the same way as before with a image just that "the image" is a div now.

Does is makes sense to give that itemprop to a <div>?

Answer

Shawn Simister picture Shawn Simister · Aug 8, 2013

CSS is not recognized by any Microdata parser that I'm aware of. You'll need to add a meta tag to specify the image like this:

<div itemscope itemtype="http://schema.org/Article">
  <meta itemprop="image" content="bg.jpg"></meta>
  <div style="background-image:url('bg.jpg')"></div>
</div>