Revision 17712 of <br>

  • Revision slug: HTML/Element/br
  • Revision title: br
  • Revision id: 17712
  • Created:
  • Creator: Softwayer
  • Is current revision? No
  • Comment 17 words added, 1 words removed; page display name changed to 'br'

Revision Content

Summary

Line break element produces a line break in text (carriage-return). It is an empty element, so it can't have any content and it can't have a closing tag (</br>). It is useful for writing a poem or address, where it is important to write everything on a new line. In XHTML documents, write this tag as <br />.

  • Allowed content: none

Attributes

break
To move down to clear past both left and right floats. Look here

Example

Mozilla Foundation<br>
1981 Landings Drive<br>
Building K<br>
Mountain View, CA 94043-0801<br>
USA

Above HTML will output:

Mozilla Foundation
1981 Landings Drive
Building K
Mountain View, CA 94043-0801
USA

Notes

Do not use <br> to increase gap between text, use CSS margin property or paragraphs (<p>)

See also

{{ HTML:Element_Navigation() }}

{{ languages( { "pl": "pl/HTML/Element/br" } ) }}

Revision Source

<h3 name="Summary">Summary</h3>
<p><strong>Line break</strong> element produces a line break in text (carriage-return). It is an empty element, so it can't have any content and it can't have a closing tag (<code>&lt;/br&gt;</code>). It is useful for writing a poem or address, where it is important to write everything on a new line. In XHTML documents, write this tag as <code>&lt;br /&gt;</code>.</p>
<ul> <li>Allowed content: none</li>
</ul>
<h3 name="Attributes">Attributes</h3>
<dl><dt>break </dt><dd>To move down to clear past both left and right floats. <a href="/en/CSS/clear">Look here</a></dd></dl>
<h3 name="Example">Example</h3>
<pre>Mozilla Foundation&lt;br&gt;
1981 Landings Drive&lt;br&gt;
Building K&lt;br&gt;
Mountain View, CA 94043-0801&lt;br&gt;
USA
</pre>
<p>Above HTML will output:</p>
<p>Mozilla Foundation<br>
1981 Landings Drive<br>
Building K<br>
Mountain View, CA 94043-0801<br>
USA</p>
<h3 name="Notes">Notes</h3>
<p><strong>Do not</strong> use <code>&lt;br&gt;</code> to increase gap between text, use <a href="/en/CSS" title="en/CSS">CSS</a> <a href="/en/CSS/margin" title="en/CSS/margin">margin</a> property or <a href="/en/HTML/Element/p" title="en/HTML/Element/p">paragraphs</a> (<code>&lt;p&gt;</code>)</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/HTML/Element/address" title="en/HTML/Element/address">HTML Address element</a></li> <li><a href="/en/HTML/Element/p" title="en/HTML/Element/p">HTML Paragraph element</a></li>
</ul>
<p>{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "pl": "pl/HTML/Element/br" } ) }}</p>
Revert to this revision