CSS: Pseudo Class

By Xah Lee. Date: . Last updated: .

What is Pseudo-Class

Pseudo-Class means the state of an element, such as in-focus, mouse hovering, clicked, checkbox checked, empty content, language spec, first child, etc.

The idea is like a fake Class Attribute to indicate state.

Example

a:link {
 text-decoration: none;
}

a:visited {
 text-decoration: none;
}

a:hover {
 background-color: pink;
}

List of Pseudo-Class Selectors

CSS, pseudo-element and pseudo-class

CSS, misc, advanced