hiding text using "text-indent"

Crippletoe picture Crippletoe · May 8, 2010 · Viewed 39.1k times · Source

I'm trying to hide some text inside an <li> element using CSS by setting text-indent: -999px;.
For some reason this doesn't work when I set the direction of the document to "rtl" (right to left - my site is in Hebrew).
When direction is "rtl" the text still shows...
Anyone knows why, and a way around this?

Answer

kaustavdm picture kaustavdm · Oct 31, 2011

Along with text-indent: -9999px try using display: block;. It solved for me.

Additionally, if you need the li elements to float horizontally (e.g. a horizontal menu), use float: left;.