Вопрос

I am trying to validate my HTML5 document with Microdata, but I am receiving a very strange error and I don't know what to do here:

Line 1, Column 14242: The itemtype attribute must not be specified on elements that do not have an itemscope attribute specified.

…mtype="http://schema.org/Organization"><span itemprop="name">Company…

This is my HTML code:

<span itemtype="http://schema.org/Organization" itemprop="hiringOrganization">
  <span itemprop="name">Company</span>
</span>
Это было полезно?

Решение

From the Microdata specification (Working Draft), section "Typed items":

The type for an item is given as the value of an itemtype attribute on the same element as the itemscope attribute.

So it should be:

<span itemscope itemtype="http://schema.org/Organization" itemprop="hiringOrganization">
  <span itemprop="name">Company</span>
</span>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top