Re: content: url() is bad

On Mon, 12 Apr 2004, Sean M. Hall wrote:
>
> I have never liked that in CSS you could do something like:
>
> element {
>   content: url(image.gif);
> }

Technically you can't, although we will indeed almost certainly be
allowing something like this in CSS3.


> By doing this CSS is leaving its territory and inserting an image into a
> document--that's HTML's job. Regular content is ok, but inserting images
> is a HTML or Javascript job.

It's actually quite common to want to do this.

For example,

   <h1>XYZ Company</h1>

with:

   h1 { content: url(xyzcompany-logo); }

...is semantically correct.

People have been trying to use "image replacement techniques" for a long
time now, and the way CSS exists right now you have to do ridiculous
things with text-indent and so forth.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 12 April 2004 05:52:06 UTC