Paragraphs
Permitted Context: %Body.Content, %flow, %block
Content Model: %text
The <P> element is used to define a paragraph. The exact
rendering (indentation, leading etc.) is not defined and may be a
function of other tags, style sheets, etc. The ALIGN attribute can be
used to explicitly specify the horizontal alignment. Paragraph elements
have the same content model as headers, that is text and character
level markup, such as character emphasis, inline images, form fields
and math.
Example:
<H1>The heading precedes the first paragraph</H1>
<P>Here is the text of the first paragraph. <P>and this is
the text of the second paragraph.
The text up to the next <p> element is treated as being part of
the current paragraph. This is an example of how SGML allows certain end
tags like </p> to be left out where they can be inferred from the context.
Word Wrapping
User agents are free to wrap lines at whitespace characters so as to
ensure lines fit within the current window size. Use the
entity for the non-breaking space character, when you want
to make sure that a line isn't broken! Alternatively, use the NOWRAP
attribute to disable word wrapping and the <BR> element to force
line breaks where desired.
Netscape includes two tags: <NOBR>...</NOBR>, and
<WBR>. The former turns off wordwrapping between the start and
end NOBR tag, while WBR is for the rare case when you want to specify
where to break the line if needed. Should HTML 3.0 provide an
equivalent mechanism to WBR, (either a tag or an entity)?
Note: Do not use empty paragraphs to add white space around
headings, lists or other elements. White space is added by the
rendering software.
Permitted Attributes
- ID
- An SGML identifier used as the target for hypertext
links or for naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope of the
current document.
- LANG
- This is one of the ISO standard language abbreviations,
e.g. "en.uk" for the variation of English spoken in the United Kingdom.
It can be used by parsers to select language specific choices for
quotation marks, ligatures and hypenation rules etc. The language
attribute is composed from the two letter language code from ISO 639,
optionally followed by a period and a two letter country code from ISO
3166.
- CLASS
- This a space separated list of SGML NAME tokens and is
used to subclass tag names. For instance, <P CLASS=abstract>
defines a paragraph that acts as an abstract. By convention, the class
names are interpreted hierarchically, with the most general class on
the left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used to
attach a different style to some element, but it is recommended that
where practical class names should be picked on the basis of the
element's semantics, as this will permit other uses, such as
restricting search through documents by matching on element class
names. The conventions for choosing class names are outside the scope
of this specification.
- ALIGN
- Paragraphs are usually rendered flush left. The ALIGN
attribute can be used to explicitly specify the horizontal
alignment:
- align=left
- The paragraph is rendered flush left (the
default).
- align=center
- The paragraph is centered.
- align=right
- The paragraph is rendered flush right.
- align=justify
- Text lines are justified where practical,
otherwise this gives the same effect as the default align=left
setting.
For example:
<p align=center>This is a centered paragraph.
<p align=right>and this is a flush right paragraph.
- CLEAR
- This attribute is common to all block-like elements. When
text flows around a figure or table in the margin, you sometimes want
to start an element like a header, paragraph or list below the figure
rather than alongside it. The CLEAR attribute allows you to move down
unconditionally:
- clear=left
- move down until left margin is clear
- clear=right
- move down until right margin is clear
- clear=all
- move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width needed
is specified as:
- clear="40 en"
- move down until there is at least 40 en units free
- clear="100 pixels"
- move down until there is at least 100 pixels
free
The style sheet (or browser defaults) may provide default minimum
widths for each class of block-like elements.
- NOWRAP
- The NOWRAP attribute is used when you don't want the
browser to automatically wrap lines. You can then explicitly specify
line breaks in paragraphs using the BR element. For example:
<p nowrap>This paragraph has wordwrap turned off<br>
and the BR element is used for explicit line breaks