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

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "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 :ho...")
 
Line 10: Line 10:
 
* The status of its content (like :checked on some form elements)
 
* 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)
 
* The position of the mouse (like :hover which lets you know if the mouse is over an element or not)
 +
 +
== Pseudo-elements ==
 +
 +
Compare [[Pseudo-element (CSS)|Pseudo-elements]].
  
 
== See also ==
 
== See also ==

Revision as of 12:31, 8 March 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