How to line-break from css, without using <br />?

Jitendra Vyas picture Jitendra Vyas · Apr 24, 2010 · Viewed 1.1M times · Source

output:

hello
How are you

code:

<p>hello <br> How are you </p>

How to achieve same output without <br>?

Answer

Vincent Robert picture Vincent Robert · Apr 24, 2010

Impossible with the same HTML structure, you must have something to distinguish between Hello and How are you.

I suggest using spans that you will then display as blocks (just like a <div> actually).

p span {
  display: block;
}
<p><span>hello</span><span>How are you</span></p>