Mobile app version of vmapp.org
Login or Join
Gonzalez347

: CSS sprite, what html tag to use I am thinking to switch to CSS Sprite for my images. The main problem is I need something compatible with alt attribute. (Seo-purpouse) What Can I use? The

@Gonzalez347

Posted in: #Css #Google #Html

I am thinking to switch to CSS Sprite for my images.
The main problem is I need something compatible with alt attribute. (Seo-purpouse)

What Can I use? The first think I thought was to use a standard

<img src="1x1.gif" class="mysprite">

The problem is I can't use that because that would like suspicous by google because of this:

<img src="1x1.gif" class="mysprite" alt="my keyword1">

<img src="1x1.gif" class="mysprite" alt="my keyword2">

<img src="1x1.gif" class="mysprite" alt="my keyword3">

(the same image "1x1.gif" with different alt text)

How we can solve this?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

2 Comments

Sorted by latest first Latest Oldest Best

 

@Rambettina238

If an alt attribute is appropriate, then the image is content.

If the image is content, then it is not a background image, should not be applied with CSS and cannot be sanely turned into a sprite.

10% popularity Vote Up Vote Down


 

@Pope3001725

CSS sprites are not used with IMG tags. They are used with CSS (as in CSS sprites). They are typically used with the background-image CSS property and :hover pseudo class. When an action occurs, usually mouseover event, the image in the background is changed by moving the background image around to the appropriate image. Showing different button states (normal, active, etc) are a common example of this. Here are some good examples of this.

FYI, the alt attribute has very little SEO value and you shouldn't be worrying about it too much especially in the case of background images. If anything it sounds like you are over optimizing.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme