[CSS3] Attribute selectors

I didn't truly realize what I said about attributes selectors in my last 
post.

I said that att=val, att~=val and att|=val limit the scope that an 
attribute presence and value selector will match a HTML attribute. All 
these selectors operate as delimiters.

http://en.wikipedia.org/wiki/String_literal#Declarative_notation


Substring attribute selectors att^=val, att$~=val and att*=val operate 
more like concatenations.


http://en.wikipedia.org/wiki/Concatenation


A few words from this says....

For example, the strings "foo" and "bar" may be concatenated to give 
"foobar".


This could mean that "" equals the point of possible concatenations. I 
believe that these empty strings in substring attributes selectors 
should match nothing and everything.

I see a use case.

[att="a"] {..}
[att="b"] {..}
div#x [att*=""] {..}


The last ruleset properties and values would be used for any element 
nested in "x" div. I could use also.

:not([class~=""])
:not([class|=""])


which matches in some cases.

http://css-class.com/test/css/selectors/att/not-attribute-presence-match-empty.htm


I see use cases involving cascadence and specificity coming into play. 
None of this has been fully explored. Just some thoughts.


Alan

http://css-class.com/test/

Received on Sunday, 6 April 2008 14:47:00 UTC