W3C home > Mailing lists > Public > www-style@w3.org > February 2004

Re: [css3] Determining the first occurence of an attribute value

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 26 Feb 2004 22:33:21 +0100
To: "Jens Meiert" <jens.meiert@erde3.com>
Cc: "W3C CSS" <www-style@w3.org>
Message-ID: <4062592d.345805582@smtp.bjoern.hoehrmann.de>

* Jens Meiert wrote:
>But the situation becomes ugly when he wants to extract the 'title' only
>once each abbreviation occurs, so he has (and that's AFAIR the only way to
>achieve the desired effect yet) to specify something like (media dependence
>assumed here, too):
>
>    acronym[title='World Wide Web Consortium']::after:first-child,
>    acronym[title='World Wide Web']::after:first-child,
>    abbr[title='Massachusetts']::after:first-child {
>    content: ' (' attr(title) ')';
>    }

Selectors do not allow to attach pseudo-classes to pseudo-elements...

>Are there already ways to solve this problem elegantly?

Yes, XPath,

  //abbr[not(preceding::abbr = .)]

Selects all abbr elements with a string value different from all
preceding abbr elements, i.e., only the first occurence of an
abbreviation.
Received on Thursday, 26 February 2004 16:33:13 GMT

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