Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
    
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 at 15:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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