Re: content: url() is bad

On Wed, 14 Apr 2004, Boris Zbarsky wrote:
> Ian Hickson wrote:
>>  D. Do something that hasn't yet been suggested.
>
> Something that was suggested was "content" to generate kids (acts as B),
> and "replacement" to make a replaced element.
>
> If replacement is set, content computes to something appropriate (there
> is precedent with the way float affects display, eg).
>
> I _think_ that's more intuitive for authors.  But maybe I'm wrong and
> the interaction of the two properties will confuse them....

The interaction of 'float' and 'display' (and 'position') is one of the
issues authors bring up all the time as examples of CSS being way too
complicated.

But it could work... Basically, have:

   img {
     replace: attr(src, uri);
     width: attr(width, px); height: attr(height, px);
     content: url(image-icon) attr(alt);
   }

   object {
     replace: attr(data, uri);
   }

   abbr[title] {
     content: attr(title);
   }

(...which is actually exactly what is in the current draft, except that in
the current draft the 'replace' values come at the start of 'content' and
there is no fallback for when 'content' is not replaced.)

I suppose I could live with that. It doesn't cascade too well, I guess...
How about actually putting it all on one property, like this:

   'content'
   Values: [ <uri> [ ',' <uri> ]+ '/' ]? [ <content-list> [ ',' <content-list> ]+ | normal

So the above would become:

   img { content: attr(src, uri) / url(image-icon) attr(alt); ... }
   object { content: attr(data, uri) / contents; }
   abbr[title] { content: attr(title); }

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

Received on Wednesday, 14 April 2004 21:49:37 UTC