ToC ~ Up ~ Prev ~ Next ~ Index Introduction to HTML
Last Update: 5 January 1998

4.3 Marking Paragraphs

The P element marks a block of text as a paragraph -- the tag <P> marks the beginning of the paragraph, while the tag </P> marks the end of a paragraph. The end tag, however, is optional, as a paragraph is automatically ended when you start another paragraph, or when you start a heading, blockquote, list, table or form.

In general, a browser will add appropriate spacings and indents to indicate the paragraph. Note that the Netscape Navigator often adds extra vertical spacing after a paragraph if you end the paragraph with a </P> end tag. This is a "bug" with Netscape, but can be used as a "feature" if you want to more finely control line spacings between a paragraph and a following element such as a table or a horizontal rule

For example, the above text, including the heading, was marked up as follows:

  <p> The P element marks a 
  block of text as a paragraph -- the tag <code>&lt;P></code>
  marks the beginning of the paragraph, while the tag
  <code>&lt;/P></code> marks the end of a paragraph. The end
  tag, however, is optional, as a paragraph is automatically
  ended when you start another paragraph, or when you start
  a heading, blockquote, list, table or form.</p>

  <p>In general, a browser will add appropriate spacings and
  indents to indicate the paragraph. Note that the Netscape
  Navigator often adds extra vertical spacing after a paragraph
  if you end the   paragraph with a <code>&lt;/P></code> 
  end tag. This is a "bug" with Netscape, but can be used
  as a "feature" if you want to more finely control line
  spacings between a paragraph and a following element such
  as a table or a horizontal rule</p>

4.3.1 Changes for HTML 3.2: Paragraph Alignment

HTML 3.2 introduced the ALIGN attribute to control the alignment of text, and also introduced ID to act as a location marker for the paragrah. More specifically:

ALIGN = "left" | "center" | "right" | "justify" (... examples)
ALIGN controls the alignment of text within the paragraph. Left and right alignment flush the text with the left and right margins, respectively, while center alignment centers the text. Justify should left and right justify the text.
Please select the "examples" anchor above to see examples of the different alignments.
ID = "name_token" (not widely supported)
Mark the paragraph for a possible reference via a URL. Thus, ID should act much like the NAME attribute of a hypertext anchor (A) element. However, this use for ID is currently only supported by the Internet Explrer 4. The value assigned to ID is a name token.

ToC ~ Up ~ Prev ~ Next ~ Index Introduction to HTML
© 1994-1998 by Ian Graham
Last Update: 5 January 1998