开发者

Best method for sprite background images, with SEO

I'm using sprite images for icons that are linked, but no text associated. I'm wondering what you feel is the best method as it relates to SEO.

Here are a few examples of how the markup could be done:

No Sprites, Just images. This would work, but with 50+ icons, it's not ideal to have each one a separate image

<a href="#">
  <img src="icon1.gif" alt="SEO Text" />
</a>

Sprites, Link with title attribute

<a href="#" class="sprite icon1" title="SEO Text">&nbsp;</a>

Sprites, Link with title attribute and/or indented anchor text (text-indent: -9999)

<a href="#" class="sprite icon1" title="SEO Text">SEO Text</a> 

Or maybe something completely different?

Thank you!

EDIT:

Another option I found could be:

Transparent image with alt text and using sprites

<img src="transparent.gif"开发者_如何学Go class="sprite icon1" alt="SEO Text" />


the best thing for SEO in this case imo is your 3rd example, using image-text replacement. however you're going to have problems on iPhone Retina 4 display, because of the double pixelation, which you can fix by targeting it with this media query @media only screen and (-webkit-min-device-pixel-ratio: 2) {}

however if images are turned off or in Windows when high contrast mode is enabled, this causes an accessibility issue. so your best bet is to use your first example, and change the images appearance via {clip:}. you can read more about it here http://www.paciellogroup.com/blog/2010/01/high-contrast-proof-css-sprites/


This question and answer at Pro Webmasters covers this perfectly

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜