16. Selector example
* All
E E tags input
E F F tags inside E tags input textarea
E>F F tags as child of E div>p
E+F F tags adjacent to E H1+p
E.C E tags with C class p.warning
E#I E tag with id as I input#name
E[A=V] ~ attribute A equals V input[type=‘text’]
E[A^=V] ~ attribute A starts with V div[title^=‘my’]
E[A$=V] ~ attribute A ends with V a[href$=‘.pdf’]
E[A!=V] ~ attribute A not equal to V form[method!=‘POST’]
E[A*=V] ~ attribute A contains V a[href*=‘google.com’]
17. Filter example
:hover when element being hovered a:hover
:first-child As first child in its parent element li:first-child
:last-child As last child in its parent element li:last-child
:nth-child(n|even|odd) As nth-child ~
li:nth-child ( 2 )
li:nth-child ( odd )
:nth-child(Xn+Y) li:nth-child ( 5n+1 )
:even
:odd
:not(selector)
Elements that is not selected by
the selector
:not( img [ src*=‘dog’ ] )