0

i'm wondering if something like the following is fine..

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Microdata Example</title>
    <meta id="site-description" name="description" content="description text here">
</head>
<body itemscope itemref="site-description" itemtype="http://schema.org/Organization">
    <h1 itemprop="name">Foo</h1>
    <img itemprop="image" src="bar.jpg">
</body>
</html>
shunryu111
  • 5,895
  • 4
  • 27
  • 16

1 Answers1

1

This won’t work.

The itemref attribute is used to reference Microdata properties, but your referenced meta element doesn’t have an itemprop attribute.

And you can’t add an itemprop attribute to the meta element if it has a name attribute.

If you don’t want to have this description visible on the page, you could

  • add the meta element in the head, using itemref:

    <head>
        <meta name="description" content="description text here">
        <meta id="site-description" itemprop="description" content="description text here">
    </head>
    <body itemscope itemref="site-description" itemtype="http://schema.org/Organization">
    </body>
    
  • add the meta element in the body, not using itemref:

    <head>
        <meta name="description" content="description text here">
    </head>
    <body itemscope itemtype="http://schema.org/Organization">
        <meta itemprop="description" content="description text here">
    </body>
    

(Assuming that you want to use Schema.org’s description property.)

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • thanks for your answer, i was hoping to find a solution that doesn't involve adding the description twice. guess it's not possible. no worries – shunryu111 Dec 09 '14 at 09:49