CSS3 Selectors

Post on 29-Nov-2014

729 views 2 download

description

 

transcript

CSS3 SelectorsBY MURILLO GRUBLER

Old selectors

*

.class

#id

element

element, element

.class element, elemento, #id

element1~element2

[attribute^=value]

[attribute$=value]

[attribute*=value]

:first-of-type

:last-of-type

:only-of-type

:only-child

:nth-child(n)

:nth-last-child(n)

:nth-of-type(n)

:nth-last-of-type(n)

:last-child

:root

:empty

:target

:enabled

:disabled

:checked

:not(selector)

::selection

New selectors

Element ~ Element

element[attribute^=value]

element[attribute$=value]

element[attribute*=value]

element:first-of-type

element:last-of-type

element:only-of-type

element:only-child

element:nth-child(n)

element:nth-child(2n - 1)Bracket the functions math

element:nth-of-type(2n - 1)

element:last-child (2n - 1)

element:empty

:not(element)