1. Home
  2. Computing & Technology
  3. Web Design / HTML

<br />

By Jennifer Kyrnin, About.com

< Previous | HTML 4.01 Tags / XHTML 1.0 Elements | Next >

Free XHTML 1.0 Class | HTML Validators | Free HTML 4.01 Class

<br /> Description:

The <br /> tag defines a forced line break within an XHTML document.

<br /> Web Browser Support:

<br /> Attributes:

All attributes are optional unless indicated.

<br /> End Tag:

None. <br /> is a singleton tag.

<br /> Contents:

None.

<br /> Valid Context:

The <br /> tag is valid within the following tags:
a, abbr, acronym, address, applet, b, bdo, big, blockquote, body, button, caption, center, cite, code, dd, del, dfn, div, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, i, iframe, ins, kbd, label, legend, li, noframes, noscript, object, p, pres q, s, samp, small, span, strike, strong, sub, sup, td, th, tt, u, var

<br /> Usage:

  • standard line break:
    This text is on the first line.
    <br />
    And this text is on the second line.
    View
  • line breaks beside an aligned image
    <img src=about_logo.gif" style="width:137px; height:48px; border: none; float: left;" alt="About.com" />
    This text will be to the right of the image.<br />
    This will be too.<br clear="left" />
    And this text will be below the image.
    View

<br /> Special Notes:

  • Match the "clear" attribute to the "float" attribute in the image or other aligned element.
  • The most commonly used "clear" attribute is "all", as it guarantees that your content will be below all aligned elements.
  • Sometimes authors may want to prevent a line break from occurring between two words. The   (non-breaking space) entity acts as a space where browsers should not cause a line break.

More <br /> Information:

< Previous | HTML 4.01 Tags / XHTML 1.0 Elements | Next >

Free XHTML 1.0 Class | HTML Validators | Free HTML 4.01 Class

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. The br Element - Forced line break - XHTML 1.0 HTML 4.0

©2008 About.com, a part of The New York Times Company.

All rights reserved.