According to Schema.org:
The image
property expects a URL or an ImageObject
item.
In Microdata, URLs must be specified with one of the HTML elements that take a URL as value. Among them is a
(with its href
attribute).
So it should be possible to use:
<a itemprop="image" href="http://example.com/my-product-image.png">…</a>
Using custom data-*
will most likely not work. Per HTML5 definition they should only be used for custom data private to the site (and not as some kind of shared vocabulary); and anway, how should consumers like Google now what your custom attributes mean/contain?
Also, it’s clearly defined to which content an itemprop
applies. In case of a
it’s the href
attribute content, not the element content, not some other attribute content.
According to Google:
Google doesn’t indicate how exactly their Products Rich Snippet works. Of course do they show in their examples the element that is typically used for images (<img itemprop="image" src="anvil_executive.jpg" />
), but their examples don’t mean that it’s the only supported way to specify an image.
data-*
attribute of ana
element instead of thesrc
element of animg
element? If yes, why do you want to usea
instead ofimg
?a
instead ofimg
tag, and I must to do it througha
tag and don't know how...