Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need a sprite technique that won't conflict with Google guidelines

Posted on 2013-05-21
6
Medium Priority
?
219 Views
Last Modified: 2013-09-20
Right now I am doing buttons and some graphics like this:

Put the buttons in a sprite image.

<a class="button" href="mylink.aspx"><span>Button text</span></a>

css:
.button
{
background: url(mybuttonimg) 0px 0px no-repeat;
display: inline-block;
height: 20px;
width: 20px;
}
.button:hover
{
background-position: 0px -30px;
}
.button span
{
position: absolute;
top: -999em;
}

However I found out that positioning the text off the page will hurt our Google rankings.

So, is anyone aware of a good technique that will still let me fetch all the buttons as one image but not violate the Google guidelines? Maybe with Javascript?

And we still want the button text, probably  as an image alt tag
0
Comment
Question by:EndeavorToPersevere
  • 2
  • 2
6 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 39185747
So is your text for the button inside the image itself? Can you post an image of your button?
0
 
LVL 2

Author Comment

by:EndeavorToPersevere
ID: 39185851
We do this all over the site but for example, here is a download button
download button sprite
The html that uses this button is
<a class="download" href="/Downloads.aspx">
<span>Download</span>
</a>

the css is
.download {
background: url(myfile.png) 0px 0px no-repeat
display: inline block;
height: 30px;
width: 124px;
}
.download:hover
{
background-position: 0px -40px;
}
.download span
{
position: absolute;
top: -999em;
}
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 2000 total points
ID: 39187294
In that case I personally wouldn't put the text inside the <a>. I would use alt and title for the a tag and leave the text out entirely.

Although I am aware that Google doesn't necessarily like hidden or severely indented text. However, are all of the words you would be hiding  that important to your SEO campaign?
0
 
LVL 2

Author Comment

by:EndeavorToPersevere
ID: 39204637
The words themselves aren't important. I'm just trying to balance looking good, not getting penalized overall for hiding text and accessibility.

Thanks for the suggestion
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question