2

Using microdata, is there a way to add an image into an Event by using a meta tag?

In the official Microdata site I see the option of adding images to events:

<img itemprop="image" src="image.jpg" alt="An image"/>

which works fine. However, I wonder if it is possible to add that image by using something like:

<meta itemprop="image" src="image.jpg"  />

which according to my tests does not work.

unor
  • 87,575
  • 24
  • 195
  • 335
oabarca
  • 10,186
  • 6
  • 56
  • 69

2 Answers2

7

Instead of using the meta element, you must use the link element (because the value is a URI):

<link itemprop="image" href="image.jpg" />

This is required by HTML5 (bold emphasis mine):

The meta element represents various kinds of metadata that cannot be expressed using the […] link […] elements.

And it’s also explicitly required by Microdata.

Community
  • 1
  • 1
unor
  • 87,575
  • 24
  • 195
  • 335
2

I just found the answer myself. For the record, meta tags must specify their value with the content attribute:

<meta itemprop="image" content="image.jpg"  />
oabarca
  • 10,186
  • 6
  • 56
  • 69