Difference between revisions of "Pseudo-class (CSS)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(External links)
 
Line 26: Line 26:
 
* [https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes Pseudo-classes] @ MDN
 
* [https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes Pseudo-classes] @ MDN
 
* [http://www.w3schools.com/css/css_pseudo_classes.asp CSS Pseudo-classes] @ W3Schools
 
* [http://www.w3schools.com/css/css_pseudo_classes.asp CSS Pseudo-classes] @ W3Schools
 +
 +
[[Category:Cascading Style Sheets]]
 +
[[Category:Web design and development]]

Latest revision as of 10:01, 18 April 2016

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