Summary
The HTML element line break <br>
produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
Do not use <br>
to increase the gap between lines of text; use the CSS {{cssxref('margin')}} property or the {{HTMLElement("p")}} element.
Content categories | Flow content, phrasing content. |
---|---|
Permitted content | None, it is an {{Glossary("empty element")}}. |
Tag omission | Must have a start tag, and must not have an end tag. In XHTML documents, write this element as <br /> . |
Permitted parent elements | Any element that accepts phrasing content. |
DOM interface | {{domxref("HTMLBRElement")}} |
Attributes
This element includes the global attributes.
- {{htmlattrdef("clear")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}
- Indicates where to begin the next line after the break.
Usage note: This attribute is obsolete in {{HTMLVersionInline(5)}} and should not be used by authors. Use the CSS {{CSSxref('clear')}} property instead.
Example
Mozilla Foundation<br> 1981 Landings Drive<br> Building K<br> Mountain View, CA 94043-0801<br> USA
The HTML above outputs:
Mozilla Foundation
1981 Landings Drive
Building K
Mountain View, CA 94043-0801
USA
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-br-element', '<br>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-br-element', '<br>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'struct/text.html#h-9.3.2.1', '<br>')}} | {{Spec2('HTML4.01')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 1.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- {{HTMLElement("address")}} element
- {{HTMLElement("p")}} element
{{HTMLRef}}