Break line without using <br> tag in HTML / CSS.

Last Updated On Monday 25th Oct 2021

new line html

  • There are various ways to break the line without using <br> tag.
  • Use block-level elements to break the line without using <br> tag.

html new line without br

  • white-space: pre; It is used to make elements acts like <pre> tag.
	<div class="preDis">
    Hello World
    Hello World
</div>
	
	.preDis {
  white-space : pre;
}
	

Hello World


Hello World

html new line without space

  • display: block; It sets the display property of elements to block.
	<h2>
    <span>Hello World</span>
    <span>Hello World</span>
</h2>
	
	h2 span {
  display: block;
}
	

Hello World
Hello World

`