HTML Tags

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:

HTML:<br>; XHTML:<br />

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.

<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
left
right
all
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.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 2.1+

Further Reading

See tutorial on: HTML Paragraph.

Related tag: <hr>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties