Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<br>

A line break inside text; `<wbr>` marks where a line may break if space runs out.

Syntax

Line one<br>Line two

Examples

An address and a poem — where the break carries meaning:

<p>12 Baker Street<br>London<br>NW1 6XE</p>
<p>Roses are red,<br>Violets are blue.</p>

A long word in a narrow box breaks where <wbr> is placed:

<p style="width: 140px; border: 1px solid silver;">
  super<wbr>cali<wbr>fragilistic<wbr>expialidocious
</p>

Notes

Both tags are single. Do not use <br> to make space between paragraphs — use separate <p> elements and margin. <wbr> is handy in long URLs and compound words; when there is enough room, the browser just keeps the line going.

See also

  • <p> — A paragraph of text.
  • <hr> — A thematic break between parts of the text; shown as a horizontal line by default.
  • <pre> — Text that keeps all spaces and line breaks.

In the tutorial

  • Headings and paragraphs — Six levels of headings, paragraphs, spaces and line breaks, the thematic break and quotes in HTML.

Thanks for reading!

Donate to the site — we work hard for you.