br Element


 

Module

The br element is an inline element declared by the XHTML 1.1 Text Module (Inline Structural)

Elements in the Text Module are:
span | br (Inline Structural Support Module)
em | strong | q | cite | abbr | acronym | code | var | kbd | samp | dfn (Inline Phrasal Support Module)
div | p (Block Structural Support Module)
h1 - h6 | blockquote | pre | address (Block Phrasal Support Module)

Description

The br element is used to introduce a new line into normal inline text without having to start a new block-level element.

For example, the code:

<p>This text is on the first line.<br />
This text is on the next line.</p>

results in the paragraph being displayed as follows:

This text is on the first line.
This text is on the next line.

Without the br, the displayed text would not contain the line break, even though the code is typed on two lines. Usually, newlines and tabs are not treated any differently than spaces and also each run of consecutive whitespace is condensed to a single space (except when whitespace is being preserved, such as within a pre element or when certain CSS declarations, e.g. white-space:pre, are used on an element). This means that you do not need to write the code above on two lines - the following would do just as well:

<p>This text is on the first line.<br />This text is on the next line.</p>

and so, in fact, would:

<p>This text is on the first line.<br /> This text is on the next line.</p>

This is because any whitespace immediately following a br element is not rendered (unless whitespace is being preserved within the parent element). For detailed information on CSS whitespace processing see: *CSS 2.1 - Whitespace: the 'white-space' property.

#REQUIRED Attributes

There are no #REQUIRED attributes on the br element.


Specific Attributes

There are no specific attributes declared on the br element.


Common Attributes

Common attributes of the br element are listed below:

From the Core Attribute Collection

class [ type NMTOKENS ]
One or more space separated classes
id [ type ID ]
A unique identifier for the element
style [ type CDATA ], from the Style Attribute Module (deprecated)
Element-specific styles
title [ type Text ]
Descriptive title for the element (in some user agents this may appear as a "tooltip" when the mouse hovers over the element)
xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]
XML namespace

Content Model

The Content Model for the br element is:

EMPTY

See Content Model & Nesting for information about Content Model syntax and Nesting Groups.

Valid children of br

This element is empty and may have no children.

Valid parents of br


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 01 Oct 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Element Index (XHTML 1.1) > br Element