Skip to main content
CSS is fun and cool and I like it.

Text Wrapping & Inline Pseudo Elements


::before / ::after

The ::before and ::after pseudo-elements in CSS allows you to insert content onto a page without it needing to be in the HTML. While the end result is not actually in the DOM, it appears on the page as if it is, and would essentially be like this:

div::before {
  content: "before";
div::after {
  content: "after";
  <!-- Rest of stuff inside the div -->

The only reasons to use one over the other are:… Read article “::before / ::after”