A line-break can be added in HTML, using only CSS, by employing the pseudo-class ::after or ::before. In the stylesheet, we use these pseudo-classes, with the HTML class or id, before or after the place where we want to insert a line-break.

In myClass::after:

This is very useful information, keep up the good work.

  1. Set the content property to "\a" (the new-line character).
  2. Set the white-space property to pre. This way, the browser will read every white-space, in myClass, as a white-space.