3

Consider this HTML:

<header>
    <div id="logo" itemscope itemtype="http://schema.org/Organization">
        <a itemprop="url" href="//www.seashellswebsite.co.uk/">
            <img itemprop="logo" src="logo.gif" alt="Seaside Shells" title="Seaside Shells">
        </a>
        <meta itemprop="name" content="Seaside Shells">
        <meta itemprop="legalName" content="Seaside Shells Ltd">
        <meta itemscope itemprop="address" itemtype="http://schema.org/PostalAddress" itemref="schemaOrganizationAddress">
        <meta itemprop="description" content="We sell sea shells on the sea shore. The sea shells we sell are unfortunately rather overpriced.">
    </div>
</header>

<h1>Super Interesting Page</h1>
<p>Foo bar.</p>

<footer>
    <span id="schemaOrganizationAddress">
        <span itemprop="streetAddress">1 Seafront Road</span>,
        <span itemprop="addressLocality">Fishing Town</span>,
        <span itemprop="addressRegion">Coastal County</span>,
        <span itemprop="postalCode">12345</span>
    </span>
</footer>

The W3C Validator complains thus:

Element meta is missing required attribute content.

… and refers to this line:

<meta itemscope itemprop="address" itemtype="http://schema.org/PostalAddress" itemref="schemaOrganizationAddress">

But what should the content attribute be here, given that the itemref attribute indicates that the content resides in another element outside the current scope? Surely the content attribute is surplus to requirement in this instance?

Alex
  • 3,029
  • 3
  • 23
  • 46
  • 1
    Note: Microdata defines [when it is allowed to have `meta` in `body`](http://stackoverflow.com/a/22415563/1591669): the `content` attribute *must* be present. – unor Aug 22 '14 at 09:31

1 Answers1

2

You can fix it by getting rid of that meta and putting itemprop="address" in the footer.

Then you can reference the container in the footer from the line with itemtype="http://schema.org/Organization".

The microdata in your code is valid though. It passes Google's richsnippet validator.

<header>
    <div id="logo" itemscope itemtype="http://schema.org/Organization" itemref="schemaOrganizationAddress">
        <a itemprop="url" href="//www.example.com/">
            <img itemprop="logo" src="logo.gif" alt="Seaside Shells" title="Seaside Shells">
        </a>
        <meta itemprop="name" content="Seaside Shells">
        <meta itemprop="legalName" content="Seaside Shells Ltd">
        <meta itemprop="description" content="We sell sea shells on the sea shore. The sea shells we sell are unfortunately rather overpriced.">
    </div>
</header>

<h1>Super Interesting Page</h1>
<p>Foo bar.</p>

<footer>
    <span id="schemaOrganizationAddress" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <span itemprop="streetAddress">1 Seafront Road</span>,
        <span itemprop="addressLocality">Fishing Town</span>,
        <span itemprop="addressRegion">Coastal County</span>,
        <span itemprop="postalCode">12345</span>
    </span>
</footer>
Dan Blows
  • 20,846
  • 10
  • 65
  • 96
Nelu
  • 16,644
  • 10
  • 80
  • 88