Pseudo-class (CSS)

From Wiki @ Karl Jones dot com
Revision as of 09:01, 18 April 2016 by Karl Jones (Talk | contribs) (External links)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In Cascading Style Sheets, a pseudo-class is a keyword added to selectors that specifies a special state of the element to be selected.

Description

For example :hover will apply a style when the user hovers over the element specified by the selector.

Pseudo-classes, together with pseudo-elements, let you apply a style to an element in relation to external factors, including:

  • The history of the navigator (:visited, for example)
  • The status of its content (like :checked on some form elements)
  • The position of the mouse (like :hover which lets you know if the mouse is over an element or not)

Pseudo-elements

Compare Pseudo-elements.

See also

External links