Using the Child Selectors

Description

The child selectors allow you to select single elements that are directly contained inside other elements.

  • :first-child
    Selects the first children of their containing elements.
    CSS Version 2
  • :last-child
    Selects the last children of their containing elements.
    CSS Version 3
  • :only-child
    Selects elements that are the only element defined by their containing element.
    CSS Version 3
  • :only-of-type
    Selects elements that are the only element of their type defined by their containing element.
    CSS Version 3




















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table