c6
c6 copied to clipboard
Review the parser for css3 selectors
Reference: http://www.w3.org/TR/css3-selectors/
-
[ ] Universal selectors and namespaces http://www.w3.org/TR/css3-selectors/#univnmsp
-
[ ] Attribute selectors and namespaces http://www.w3.org/TR/css3-selectors/#attrnmsp
-
[ ] :nth-child() pseudo-class: The nth grammar:
nth : S* [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? | ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* ;Examples:
tr:nth-child(2n+1) /* represents every odd row of an HTML table */ tr:nth-child(odd) /* same */ tr:nth-child(2n+0) /* represents every even row of an HTML table */ tr:nth-child(even) /* same */ /* Alternate paragraph colours in CSS */ p:nth-child(4n+1) { color: navy; } p:nth-child(4n+2) { color: green; } p:nth-child(4n+3) { color: maroon; } p:nth-child(4n+4) { color: purple; } -
[ ] Move
lang(),empty(),not()to function pseudo selector