In CSS, pseudo-element is used to style detailed and specific parts of an element.

For example, it may be used to:
  • Style an element, letter or line.
  • Insert content in an element before or after the content within the element.

It is a keyword added to a selector that lets you in styling a specific part of the selected element(s).

For example, ::first-line is used to change the font of the first line of a paragraph below.

p::first-line {
   color: blue;
   text-transform: uppercase;
}

BY Best Interview Question ON 11 Mar 2020