: 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
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?
More posts by @Gonzalez347
2 Comments
Sorted by latest first Latest Oldest Best
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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.