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

 > 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 UTC