This article say we should avoid using this technique. This one says it's awesome. Is it true that Google looks inside CSS files for text-indent: -9999px;
and punishes you? :|
I'm using that property a lot to hide text. For example, I have a button that is represented by an icon:
<a href="#" class="mybutton">do Stuff</a>
The CSS:
.mybutton{
text-indent: -9999px;
background: transparent url(images/SpriteWithButtons.png) no-repeat 20px 20px;
display: block;
width: 16px;
height: 16px;
}
I don't see any alternative to my code. If I replace that with an image I automatically get +20 HTTP requests for each button image.
If I make the link empty, it is less accessibile because screen readers won't know what that is. And empty links look weird, probably Google doesn't like that either...
So what's the best way to handle such situations?
padding-top: 9999px
andoverflow: hidden
. – Frankie<a title="do stuff" href="#" class="mybutton"></a>
is "better" but one can hardly know for sure ... – Chur