HTML <br>
Tag
Topic: HTML5 Tags ReferencePrev|Next
Description
The <br>
tag produces a line break in text.
The following table summarizes the usages context and the version history of this tag.
Placement: | Inline |
---|---|
Content: | None. It is an empty element. |
Start/End Tag: | Start tag: required, End tag: forbidden |
Version: | HTML 2, 3.2, 4, 4.01, 5 |
Syntax
The basic syntax of the <br>
tag is given with:
Note: In HTML, the end tag for the <br>
tag is forbidden. In XHTML, the <br>
tag must be closed with a trailing slash like this: <br />
. See empty elements.
The example below shows the <br>
tag in action.
Example
Try this code »<p>This paragraph contains <br>a line break.</p>
<p>This paragraph contains <br>multiple <br>line breaks.</p>
Tip: The <br>
tag should be used only for line breaks that are actually part of the content e.g. line breaks inside poems or addresses.
Tag-Specific Attributes
The following table shows the attributes that are specific to the <br>
tag.
Attribute | Value | Description |
---|---|---|
clear |
none |
Obsolete Specifies where the next line should appear after the line break caused by this element. |
Global Attributes
Like all other HTML tags, the <br>
tag supports the global attributes in HTML5.
Event Attributes
The <br>
tag also supports the event attributes in HTML5.
Browser Compatibility
The <br>
tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Paragraph.
Related tag: <hr>
.