Complete CSS Pseudo-Class Reference

Classified in Computers

Written on in English with a size of 10.29 KB

CSS Pseudo-Class Reference

SelectorExampleDescription
:activea:activeSelects the active link.
:checkedinput:checkedSelects every checked element.
:disabledinput:disabledSelects every disabled element.
:emptyp:emptySelects every <p> element that has no children.
:enabledinput:enabledSelects every enabled element.
:first-childp:first-childSelects every <p> element that is the first child of its parent.
:first-of-typep:first-of-typeSelects every <p> element that is the first <p> element of its parent.
:focusinput:focusSelects the element that has focus.
:hovera:hoverSelects links on mouse over.
:in-rangeinput:in-rangeSelects elements with a value within a specified range.
:invalidinput:invalidSelects all elements with an invalid value.
:lang(language)p:lang(it)Selects every <p> element with a lang attribute value starting with "it".
:last-childp:last-childSelects every <p> element that is the last child of its parent.
:last-of-typep:last-of-typeSelects every <p> element that is the last <p> element of its parent.
:linka:linkSelects all unvisited links.
:not(selector):not(p)Selects every element that is not a <p> element.
:nth-child(n)p:nth-child(2)Selects every <p> element that is the second child of its parent.
:nth-last-child(n)p:nth-last-child(2)Selects every <p> element that is the second child of its parent, counting from the last child.
:nth-last-of-type(n)p:nth-last-of-type(2)Selects every <p> element that is the second <p> element of its parent, counting from the last child.
:nth-of-type(n)p:nth-of-type(2)Selects every <p> element that is the second <p> element of its parent.
:only-of-typep:only-of-typeSelects every <p> element that is the only <p> element of its parent.
:only-childp:only-childSelects every <p> element that is the only child of its parent.
:optionalinput:optionalSelects elements with no "required" attribute.
:out-of-rangeinput:out-of-rangeSelects elements with a value outside a specified range.
:read-onlyinput:read-onlySelects elements with a "readonly" attribute specified.
:read-writeinput:read-writeSelects elements with no "readonly" attribute.
:requiredinput:requiredSelects elements with a "required" attribute specified.
:root:rootSelects the document's root element.
:target#news:targetSelects the current active #news element.
:validinput:validSelects all elements with a valid value.
:visiteda:visitedSelects all visited links.

Related entries: