Re: content: url() is bad

On Tue, 13 Apr 2004 17:51:28 +0000 (UTC), Ian Hickson <> wrote:

> One of my requirements is "be able to describe <img> in CSS easily".
> How would you do this, using your suggestion?
> Using my suggestion, it's:
>    img { content: attr(src, uri), attr(alt), none;
>          width: attr(width, px); height: attr(height, px); }
> ...which basically means one reasonably simple extension to 'content',  
> and
> the use of 'attr()', which will be introduced in CSS3 Values and Units.

Why do we need to implement all that for an image in CSS? If the image  
requires alt-text, it is content and therefore should be part of the HTML  
(etc) document and not CSS. If the image provides no content (i.e. is  
stylistic only) and hence no alt text, then it is appropriate for CSS, and
content: url('./example.png');
is appropriate, possibly with width: and height: being specified if  
necessary. A UA that doesn't support images (or has disabled them) should  
not replace the content/draw the box for the image.


Received on Tuesday, 13 April 2004 17:08:54 UTC