Utilizor
Contact Us

CSS Pseudo-elements

A complete list of CSS pseudo-elements.

CSS Pseudo-Elements Reference

A pseudo-element is used to style specified parts of an element.

Selector Example Description
::after p::after Insert content after every <p> element
::before p::before Insert content before every <p> element
::first-letter p::first-letter Selects the first letter of every <p> element
::first-line p::first-line Selects the first line of every <p> element
::selection ::selection Selects the portion of an element that is selected by a user

Example

/* Add content before every paragraph */
p::before {
  content: "Read this: ";
  font-weight: bold;
}