code icon

CSCI 1720

Intermediate Web


× INDEX
ANIMATION BACKGROUND BORDER BOX COLUMN COLORS FONT LIST POSITIONING PSEUDO TRANSITIONS TEXT

Pseudo-Classes

Pseudo-Class Applies To
:active an activated element
:focus an element while the element has focus
:hover an element when you mouse over it
:link an unvisited link
:disabled an element while the element is disabled
:enabled an element while the element is enabled
:checked an element that is checked
:selection an element that is currently selected or highlighted by the user
:lang allows the author to specify a language to use in a specified element
:nth-child(n) an element that is the n-th sibling
:nth-last-child(n) an element that is the n-th sibling counting from the last sibling
:first-child an element that is the first sibling
:last-child an element that is the last sibling
:only-child an element that is the only child
:nth-of-type(n) an element that is the n-th sibling of its type counting from the last sibling
:nth-last-of-type(n) an element that is the last sibling of its type
:last-of-type an element that is the last sibling of its type
:first-of-type an element that is the first sibling of its type
:only-of-type an element that is the only child of its type
:empty an element that has no children
:root root element within the document
:not(x) an element not represented by the argument ‘x’
:target a target element as specified by a target in a UR

Pseudo-Elements

Pseudo-Element Applies To
::first-letter adds special style to the first letter of a text
::first-line adds special style to the first line of a text
::before inserts some content before the content of an element
::after inserts some content after the content of an element






Learn More
Pseudo-Classes are used to define a special state of an element. Pseudo-Elements are used to style specified parts of an element