W3C home > Mailing lists > Public > www-style@w3.org > April 1998

Re: The attribute selectors [x|=a] and [x~=a]

From: Steven Pemberton <Steven.Pemberton@cwi.nl>
Date: Fri, 17 Apr 1998 09:45:55 +0200 (MET DST)
To: Ian Hickson <exxieh@bath.ac.uk>
Cc: www-style@w3.org
Message-ID: <13623.1767.563305.638771@schoener.cwi.nl>
 > I suggest
 > [att =val]
 > [att-=val]

Just to give you some insight into how the operators developed, the
original suggestion was "==" for equality, and "=" for space separated
lists.

However, it was felt that "==" was too geeky, so they were changed to
"=" for equality (fair enough I think you'll agree), and "~=" for
space separated equality ("sort of equal").

Later there was a requirement to be able to match on language codes
for the LANG attribute, which have the form "en" "en-uk" "en-us"
"en-uk-cockney", and you want to be able to match on all LANGs that
start "en", or "en-uk". So "|=" was introduced for this. Note that
"|=" has an extra semantic property that the other two don't, namely
that it matches case insensitively, so they aren't really a
cooperating set of operators.

In any case " =" couldn't be an operator alongside "=", since
whitespace is nearly always ignored in CSS2. "_=" might be a
possibility.

Steven Pemberton
Received on Friday, 17 April 1998 03:46:04 GMT

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