Back to TIL
March 2025
posted on 03.08.2025

CSS pseudo-classes and pseudo-elements

Pseudo-classes are states applied to the selected elements. They have a single colon (:).

button:hover {
  background: red;
}

Pseudo-elements selects specific parts of the selected elements. They have double colons (::).

p::first-line {
  text-transform: uppercase;
}
No reactions yet

2026.10.01 07:01:06 in Naperville, IL
Last visitor from Mitaka, Japan
Theme
Color theme
⌘K