Re: replacing images with alt attribute text

At 2000-11-26T20:02+0100, Bjoern Hoehrmann wrote:-

> img {
>   display: none;
> }
>
> img:before {
>   content: attr(alt);
>   display: inline;
> }
>
> should to the trick. Is this the right way or isn't this possible at all?

I'm pretty sure that with display: none any :before or :after content
should also not be displayed - as suggested by the selector, it is still
to some extent part of the img element. Remember that display: none
*cannot* be overridden on descendants - I think I would expect this to
hold for pseudo-elements too. I don't think there's any nice way around
this, at least before CSS3.


Tim Bagot

Received on Sunday, 26 November 2000 15:56:48 UTC