HTML br tag

HTML br tag breaks one line text into multiline text. It is empty type element.

Example

<p>
 This text can 
 not be broken into
 two lines. This will appear as
 one line.
 </p>
	
 <p>
 This text can <br>
 be broken into two <br>
 lines.
 <br>
 The br tag is breaking a paragraph into multiple lines.
</p>
Try </>

In the above example, if we do not use br tag and break the paragraph then paragraph retains its behavior.

But the presence of br tag causes the single line paragraph to break into a multiline paragraph.

Specific uses

Common uses of br element.

  • poem

  • address

Example

<!DOCTYPE html>
<html>
<body>
 <p> For example ,Harvard University address </p>
 <address>
  Address: Cambridge, MA 02138, USA <br>
  Phone:+1 617-495-1000
 </address>
</body>
</html>
Try </>

Instead of using br elements for presentational purposes pre element should be used.

Tag omission

br is self-closing tag (<br />) i.e. there is no end tag.

Global Attributes

All the global attributes are applicable on the br element.



Was this article helpful?

 

Email:

Message:

Get the newsletter