braillespecs / braille-css

Braille CSS specification
http://braillespecs.github.io/braille-css
2 stars 1 forks source link

Selectors #25

Open bertfrees opened 9 years ago

bertfrees commented 9 years ago

Add a section about selectors.

See

bertfrees commented 9 years ago

This is an overview of the selectors that have been tested and work with the existing implementations:

Category Pattern Matches
Universal selector * any element
Type selectors E any element E
Descendant selectors E F any element F that is a descendant of element E
Child selectors E > F any element F that is a child of element E
Adjacent selectors E + F any element F immediately preceded by a sibling element E
Attribute selectors E[foo] any element E with a "foo" attribute
[foo] *[foo]
E[foo="bar"] any element E whose "foo" attribute value is "bar"
E[foo~="bar"] any element E whose "foo" attribute is a list of space-separated values, one of which is equal to "bar"
E[foo="bar"] any element E whose "foo" attribute has a hyphen-separated list of values beginning with "bar"
Class selectors E.bar E[class~="bar"]
.bar *.bar
ID selectors E#bar any element E with ID equal to "bar"
#bar *#bar
Pseudo-classes E:first-child any element E that is the first child of its parent
E:last-child any element E that is the last child of its parent
E:nth-child(n) any element E that is the nth child of its parent
E:only-child any element E that has no siblings
bertfrees commented 8 years ago

Additional selectors: