O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

<P> — NN all IE all HTML all

Synopsis

<P>...</P>

End Tag: Optional

A P element defines a paragraph structural element in a document. With HTML 4.0, the P element is formally a block-level element, which means that content for a P element begins on its own line, and content following the P element starts on its own line. No other block-level elements may be nested inside a P element. If you omit the end tag, the element ends at the next block-level element start tag.

The nature of the P element has changed over time. In early implementations of HTML, the element represented only a paragraph break (a new line with some extra line spacing). Version 4 browsers render P elements in a hybrid way such that the start tag of a P element inserts a line space before the block. This means that a P element cannot start at the very top of a page unless it is positioned via CSS-P. Use the P element for structural purposes, rather than formatting purposes.

Content of a P element does not recognize extra whitespace that appears in the source code. Other elements, such as PRE, render content just as it is formatted in the source code.

Example

<P>This is a simple, one-sentence paragraph.</P>
<P>This second paragraph starts on its own line, with a little extra 
line spacing.</P>

Object Model Reference

IE

[window.]document.all.elementID

Attributes

ALIGN

DIR

LANG

STYLE

TITLE

CLASS

ID

LANGUAGE

  

Event Handler Attributes

Handler

NN

IE

HTML

onClick

n/a

4

4

onDblClick

n/a

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required