CSS: What is Pseudo Class

By Xah Lee. Date: . Last updated: .

CSS Pseudo-Class Selectors is a misc set of CSS Selector Syntax.

Their syntax all have the form

tagName:pseudoClassName

They match HTML/XML elements in some particular way, by criterion of nesting structure relationship with other elements, or user interface state, or other misc criterion.

Example:

/* pseudo-class CSS selectors, to color links */
a:link {
text-decoration:none;
}

a:visited {
text-decoration:none;
}

a:hover {
background-color:pink;
}

Here is a complete list of pseudo-class: