You can add a line break in HTML using the <br>
tag. It works in all browsers.
The <br>
tag is a so-called “empty tag”, which means it doesn’t need a closing tag.
In the base case you can just insert it between your HTML tags.
<div>
<p> Hey there! </p>
<br>
<p> This text will be displayed on a new line! </p>
</div>
Or you can use the <br>
tag in the <p>
tag directly.
<p>first<br>second<br>third</p>
In the example above, the strings first
, second
and third
will be displayed on 3 separate
lines.