For element E: E[attr^="val"] Attribute value which begins with "val" E[attr$="val"] ... which ends with "val" E[attr*="val"] ... with the substring "val" E:root Only if root of document E:nth-child(n) Only if also the nth child of its parent E:nth-last-child(n) ... counting from the end E:nth-of-type(n) The n-th E element sibling E:nth-last-of-type(n) ... counting from the end E:last-child Only if last child (first-child is in CSS2) E:first-of-type First E element sibling E:last-of-type Last E element sibling E:only-child If only child of parent E:only-of-type If only child of type E of parent E:empty With no text or element children E:target Identified by browser via fragment identifier E:enabled User interface element which is enabled E:disabled ... which is disabled E:checked ... which is checked (checkbox / radio button) E::selection ... portion selected/highlighted by user. E:not(S1) Not matching additional selector S1 E ~ F With sibling F following (not immediately)
cheat sheets.
$ cheat css3_selectors( add new | see all )
- updated sheets

- shoulda
- capistrano
- rpm
- string
- sqld4r
- cheat_el
- cheat
- magit
- to_i
- bm
- rails_date_formats
- sequel
- dexagogo_form_validation
- git
- git_remote_branch
Advertisement