Tree Structural

  • :root is usually the `html` element.
  • :empty matches all elements with no children besides whitespace.
  • :nth-child matches the An+Bth sibling.
  • :nth-last-child matches the An+Bth sibling from the end.
  • :first-child matches the first of its siblings.
  • :last-child matches the last of its siblings.
  • :only-child matches elements with no siblings.
  • :nth-of-type matches the An+Bth sibling of the specified type.
  • :nth-last-of-type matches the An+Bth sibling of the specified type, from the end.
  • :first-of-type matches the first sibling of the specified type.
  • :last-of-type matches the last sibling of the specified type.
  • :only-of-type matches elements with no siblings of the specified selector.