Icon Fonts are Awesome ?
In a recent tweet conversation with @nhoizey and @htmlzg, we discuss shortly about this blogpost Icon Fonts are Awesome.
I really don’t like the
text-indent: -9999px;
option, because this one wasn’t relly good for SEO.
So, based on the CSS proposed in the previous blogpost, I suggest to use the following one :
HTML
<div class="icon icon-replace icon-check">Check</div>
CSS
.icon:before {
font-family: icons;
}
.icon-replace {
overflow: hidden;
display: inline-block;
position: relative;
width: 1em;
height: 1em;
text-indent: 1em;
}
.icon-replace:after {
position: absolute;
left: 0;
top: 0;
text-indent: 0;
}
Why :after in place of :before ? Just because in the logical stream, the content appears after, so in front of the text.
I’m not sure about this solution, but this one doesn’t use the ugly negative text-indent.