W3C home > Mailing lists > Public > www-style@w3.org > September 2003

Re: attr(x, y)

From: James Craig <work@cookiecrook.com>
Date: Mon, 29 Sep 2003 10:14:59 -0500
Message-ID: <3F784C73.6070809@cookiecrook.com>
To: www-style@w3.org
Cc: Roland Tepp <roland.tepp@mail.ee>

Roland Tepp wrote:

> Now I'm not really that fluent, as I allready mentionedd before, in understanding all
> the ugly details of parsing CSS, but to my everyday user (and programmer)
> point of view this looks rather wrong - afaik this form of string
> concatenation is not allowed today, so why should it be allowed in CSS3?
> (please correct me if I'm wrong...)

The syntax was correct and it is allowed today in some circumstances. 
Take this example that works in modern browsers (Not IE):

/* href value starts with '/' */
a[href^="/"]:after {
   content: " (http://www.mydomain.com" attr(href) ")";
   }

Would take this element:
  <a href="/foo.htm">Link text</a>

And print:
  Link text (http://www.mydomain.com/foo.htm)

Cheers,
James raig

-- 
http://www.cookiecrook.com/
Received on Monday, 29 September 2003 11:15:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:23 GMT