HTML Basics
Stanford University Libraries & Academic Information Resources

P
Paragraphs

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]

The p element encloses a paragraph, or a paragraph-like block of text. Since nearly every bit of text (or image) in the body of your document must be enclosed in a "container" element, most of your document will normally be enclosed betweeen <p> and </p> tags.

Always remember that HTML doesn't care about whitespace (with just a few exceptions), so line breaks, multiple spaces, and tabs, will all get compressed into a single space. If you need to force a line break where there ordinarily wouldn't be one, you must use the br tag wherever you need a line break within the <p> element.

Example

    <p>The Modern Language Association of America
    urges the entire
    community of readers and scholars to recognize that the future of
    humanistic study            depends on the preservation of

    original materials, even after the
    texts in them have been made
    available in other forms.  Two developments in recent years have
    given rise to widely publicized discussions that stress the value of
    textual reproductions for scholarship and imply the disposability of
    many of the artifacts that originally transmitted those texts. One
    is the organized effort for microfilming books containing brittle
    paper; the other is the production
    of electronic texts.  All
    scholars, indeed all readers, should applaud both the concern that
    has been shown for the survival of texts printed on acidic paper and
    the technical advances that permit the dissemination and
    manipulation of texts from the past in electronic form.  But the
    advantages of the new forms in which old texts thus appear must not
    be allowed to obscure the fact
    that the new forms cannot fully
    substitute for the actual physical objects in which those earlier
    texts were embodied at particular past times.</p>

    <p>Without broad public awareness of the significance of
    originals, sizable portions of certain classes of textual artifacts
    (especially nineteenth- and twentieth-century printed books) face
    destruction. The MLA is expressing no opinion about the relative
    desirability of different forms of presentation for future writing;
    rather, it is strictly concerned with the future study of texts (of
    all kinds) that originally appeared on paper, in the form of
    manuscripts and printed material.  By outlining the theoretical
    reasons for the importance of originals (applicable to nonverbal
    artifacts as well) and offering some practical recommendations that
    emerge from them, the MLA wishes to promote understanding of the
    issues and to stimulate action on them.</p>

which is rendered:

The Modern Language Association of America urges the entire community of readers and scholars to recognize that the future of humanistic study depends on the preservation of original materials, even after the texts in them have been made available in other forms. Two developments in recent years have given rise to widely publicized discussions that stress the value of textual reproductions for scholarship and imply the disposability of many of the artifacts that originally transmitted those texts. One is the organized effort for microfilming books containing brittle paper; the other is the production of electronic texts. All scholars, indeed all readers, should applaud both the concern that has been shown for the survival of texts printed on acidic paper and the technical advances that permit the dissemination and manipulation of texts from the past in electronic form. But the advantages of the new forms in which old texts thus appear must not be allowed to obscure the fact that the new forms cannot fully substitute for the actual physical objects in which those earlier texts were embodied at particular past times.

Without broad public awareness of the significance of originals, sizable portions of certain classes of textual artifacts (especially nineteenth- and twentieth-century printed books) face destruction. The MLA is expressing no opinion about the relative desirability of different forms of presentation for future writing; rather, it is strictly concerned with the future study of texts (of all kinds) that originally appeared on paper, in the form of manuscripts and printed material. By outlining the theoretical reasons for the importance of originals (applicable to nonverbal artifacts as well) and offering some practical recommendations that emerge from them, the MLA wishes to promote understanding of the issues and to stimulate action on them.

Markup

The <p> tag is required at the beginning of the paragraph, but the end-tag </p> is optional. Nevertheless, consistently including the end-tag is a good practice, and make certain types of automated processing easier. More importantly, it helps to make explicit exactly where your paragraph really ends, which may differ quite significantly from where you as an author would have it. The ambiguity arises from the fact that HTML prescribes quite rigidly which elements may nest inside other elements. The only things that may occur in the <p> element are

Note that <p> can not contain several elements that, in ordinary usage, would be part of a proper paragraph, viz

So, for example, while an author would construct:

    <p>Abraham lincoln's famous speech
        <blockquote>Four score and seven...
        </blockquote
    is an  example of blah blah blah
    </p>

this must, in fact,be marked up as:

<p>Abraham lincoln's famous speech</p>
    <blockquote>Four score and seven...
    </blockquote
<p>is an  example of blah blah blah
</p>

Similar workarounds must be employed for preformatted text, lists, and addresses.

Obsolete usage

In earlier versions of HTML, <p> was used in a different fashion, as a "paragraph separator" rather than as a "container". That is, <p> was used as an "empty" element (i.e. like <br>, it had no end tag) and was placed between paragraphs rather than marking the beginning of a paragraph, e.g.

<h2>Copying</h2>
The idea of copying a tape every year is absurd.  If the problem
is with the format, then I suggest copying the information to a
proven format.  That will require only one copy, not one every
year!<P>
There are no common magnetic fields strong enough to erase
magnetic tapes and discs, unless the media is purposely placed next
to a magnet.  This concern keeps being repeated by people who do not
understand magnetics.

Even though this usage is now obsolete and new documents should not employ it, you will still find books and tutorials insisting on the no-longer-legal usage. These sources are out-of-date and should be ignored. Documents using the obsolete usage are not legal HTML 2.0 documents.

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]


Walter Henry
Stanford University Libraries and Academic Information Resources