Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

A while back, I answered this question on Stack Overflow:

http://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements

The problem is that elements with display: inline-block have "extra gaps", due to being affected by whitespace in the HTML, see: http://jsfiddle.net/thirtydot/4z4v2/

As shown, the gaps can be removed by removing the whitespace in the HTML. However, removing that whitespace is sometimes an undesirable fix: for example, it makes the HTML more difficult to work with.

So, I suggested this workaround: http://jsfiddle.net/thirtydot/4z4v2/1/

ul {
    font-size: 0;
    letter-spacing: -1px;
}
li {
    font-size: medium;
    letter-spacing: normal;
}

(letter-spacing is required to fully eradicate the gap in Safari)

And that was that..

..until a comment popped up when this technique was suggested in another answer:

Be careful with this code because it might be interpreted by web crawlers as abuse since you are explicitly hiding text inside an element containing links. Its true that the links itself are visible thanks to a higher specificity rule but still web crawlers see a bunch of links inside a container which tells all of its ancestors to hide their textual content.

I've used this technique on only one site (..I usually just remove the whitespace), and the site has ranked properly on Google (no link, sorry). If it matters, the site has pages targeted very specifically in the format of "Phrase + Location": as a fictitious example "Zombie Chopper Ravenholm".

I only really care about Google, but answers concerning other search engines are also welcome.

So, my question is:

Is the mere presence of font-size: 0 a risk for SEO, even though no text is ever actually hidden?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

Google is not out to penalize techniques. They're out to to punish bad intentions. Just as display:none can be used both for legitimate purposes and black hat SEO, the same holds true for other CSS rules. In your case text is never hidden and is available and visible to both search engines and users so you should be fine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.