Description
HTML element <br>
is used to produce a line break within a text of an HTML document.
The line break must be used only to produce line breaks and not to produce blank lines between the paragraphs.
The below table summarizes its usage.
Usage Details | |
Placement | It is displayed as an Inline element. |
Contents | It is an empty element, which doesn't contain any content. |
Tags | Only an opening tag is required. |
Versions | HTML 2, 3.2, 4, 4.01, and 5 |
Syntax
<br>
Examples
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h1>Heading</h1>
<p>Paragraph content has a line break <br>which moves the content from here to the next line.</p>
</body>
</html>
Attributes
The following table shows the list of supported and unsupported attributes for the <br>
tag.
Attribute Type | Details |
Tag-Specific Attributes | The tag <br> does not have any tag-specific attributes. |
Global Attributes | Like all other HTML tags, the tag <br> supports the HTML Global Attributes. |
Event Attributes | The tag <br> also supports the HTML Event Attributes. |
Browser Compatibility
The tag <body>
is supported in all modern browsers.
- Google Chrome 1+
- Internet Explorer or Edge 2+
- Firefox 1+
- Apple Safari 1+
- Opera 2.1+