BR HTML

HTML <br> Tag

To break a line in a paragraph, the HTML <br> tag is used. It is especially useful for poems or addresses where the line break is necessary. Being an empty tag, it does not need a closing tag. The HTML <br> tag is not meant to be used for the margin between two paragraphs. CSS margin property can be used instead.

Use of HTML <br> and <br/> tags:

The HTML <br> tag need not be closed but in XHTML it must be properly closed like this: <br/>. The HTML <br> tag can however be used in both ways: <br> or <br/>. Since the <br/> tag is supported in HTML and XHTML, it is thus recommended to use the <br/> tag.

Example:

<!DOCTYPE html>
<html>
<body>
<p>
Hello World!!<br>How are you all?<br>Today is a great day for learning.
</p>
</body>
</html>

Explanation:

In the above example, we have used the HTML <br> tag to break lines within a paragraph.

Global Attributes:

All the Global attributes are supported by the HTML <br> tag.

Event Attributes:

All the Event attributes are supported by the HTML <br> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera, and Safari.