← All tutorials

GoCareerGo Tutorials

CSS Tutorial

Selectors, box model, Flexbox, Grid, animation and responsive design.

Pseudo-Elements

::before and ::after inject generated content into an element without adding extra HTML markup.

.required::after {
  content: " *";
  color: red;
}
Tip

Know the distinction: pseudo-CLASS targets a state (:hover), pseudo-ELEMENT creates a virtual sub-element (::before).