Blog > How to add a line break between two inline elements

How to add a line break between two inline elements

Published on Thursday, April 16, 2020 by pagemuse


If you need to have two inline elements where one breaks into the next line within another element, you can accomplish this by adding a pseudo-element :after with content:’\A’ and white-space: pre

HTML

This is the main label secondary label

.label:after {
    content: '\A';
    white-space: pre;
}