Previous post

CSS troubles: Negative text-indent not hiding your text?

I am so totally thankful for this post I found today by Adam Bard.

If you’re using the tried-and-true negative text-indent for image replacement technique whilst building a website, make sure that the element you’re working with is not aligned to the right.

Simply setting text-align: left will fix this problem.

Thanks, Adam Bard! :) This problem had me stumped for a while.

Comments on this post

Ryan's gravatar
Hey Max,

What's the utility of using a negative text-indent?
From Ryan on October 16th, 2011.
Christopher's gravatar
Ryan, if you're using a background image replacement method for image-text, then you can use a negative indent in order to shuffle the text off the page.
From Christopher on October 19th, 2011.
Max's gravatar
Couldn't have said it better myself. This technique gets used a lot for things like logos or icons.
From Max on October 19th, 2011.

Leave your own comment