br ElementThe 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)
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.
There are no #REQUIRED attributes on the br element.
There are no specific attributes declared on the br element.
br element are listed below:class [ type NMTOKENS ]id [ type ID ]style [ type CDATA ], from the Style Attribute Module (deprecated)title [ type Text ]xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]br element is:
EMPTY
See Content Model & Nesting for information about Content Model syntax and Nesting Groups.
brThis element is empty and may have no children.
brabbr, acronym, address, cite, code, dfn, div, em, h1 - h6, kbd, p, pre, q, samp, span, strong, varadd, dt, licaption, td, thbutton, fieldset, label, legendb, big, i, small, sub, sup, ttdel, insbdoobjectrb, rt