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
|
|
|
|
|
|
|
|
Event Handler Attributes
Handler |
NN |
IE |
HTML |
---|---|---|---|
onClick |
n/a |
4 |
4 |
onDblClick |
n/a |
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.