5

Google gives this example to markup your logo:

<div itemscope itemtype="http://schema.org/Organization">
  <a itemprop="url" href="http://www.example.com/">Home</a>
  <img itemprop="logo" src="http://www.example.com/logo.png" />
</div>

http://googlewebmastercentral.blogspot.ca/2013/05/using-schemaorg-markup-for-organization.html

But that example has the img outside the anchor, I want to put it inside...so I'm wondering can I do it this way instead:

<a itemscope itemtype="http://schema.org/Organization" href="http://www.example.com/">
  <img itemprop="logo" src="http://www.example.com/logo.png" />
</a>

Is this valid? Note: I took out the URL itemprop.

7

This should work because it still uses the logo and URL itemprops within the itemscope of 'Organisation' which is ultimately the markup it is looking for.

<div itemscope itemtype="http://schema.org/Organization">
    <a itemprop="url" href="http://www.example.com/">
        <img itemprop="logo" src="http://www.example.com/logo.png" />
    </a>
</div>

I'd expect this to work if you ran it through Google's rich snippet testing tool to confirm.

0

I advise you to use the code proposed by Google and it works.

<div itemscope itemtype="http://schema.org/Organization">
  <a itemprop="url" href="http://www.example.com/">Home</a>
  <img itemprop="logo" src="http://www.example.com/logo.png" />
</div>  

The main reason is that the code is well structured and the scope is clear around the links and the related image. I'm not completely sure if the second code you proposed will work. I think no.

itemprop="logo" property defines the logo URL using the URL related the value of src.

  • 1
    Whilst it normally pays to follow the advice of Google, the Schema that Google provides are only examples of scenarios. It would be impossible to list every possible combination of Schema markup. As long as itemprops available within an itemscope can be found within, then the markup should still be valid. – zigojacko Feb 11 '14 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.