[thelist] CSS 0px image replacement

Shawn K. Quinn skquinn at speakeasy.net
Mon Dec 5 23:52:56 CST 2005

On Mon, 2005-12-05 at 18:38 +0000, Danny King wrote:
> I'm looking into image replacement using CSS and have a good idea on the 
> various popular methods mentioned on the main sites, however one technique I 
> noticed whist looking at someones source doesn't seem to documented widely.
> Rather than shoving the text off the screen with a huge negative indent, the 
> text size was set to 0 (and a background image loaded in for the div). This 
> seemed a neater (and nicer) way of doing things.
> I was wondering if screen readers actually read text with a size of 0? Are 
> there any issues with this sort of image replacement?

I don't see what's so wrong with just using the alt attribute of <img>
myself (until <object> gets better support); it's easy to forget that
CSS can be overridden, mangled by something like Privoxy, or not
processed at all.

'font-size: 0;' is an ugly hack and, to me, while it might be
technically legal CSS, just has that aura of "asking for problems".

Shawn K. Quinn <skquinn at speakeasy.net>

More information about the thelist mailing list