HTML how to use P element

Tutorials and tips

<P>..</P> element

A p element defines a paragraph structural element in a document. With HTML 4, the p element is formally a block-level element, wich 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 (not permissible in XHTML), 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 and later browser 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. Use the p element for structural purpose, rather then formatting purposes.

The 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.