HTML <p> Element

The HTML <p> element represents a paragraph of text and is one of the most commonly used elements for organizing written content on a webpage.

Syntax

<p>This is a paragraph of text.</p>

The <p> element normally uses an opening and closing tag, with the paragraph content placed between them.

Attributes

The <p> element supports the global HTML attributes. It does not have any element-specific attributes.

Example

This example uses several <p> elements to separate related text into individual paragraphs.

Play in Editor

Usage Notes

Use the <p> element for paragraphs of text rather than adding multiple <br> elements to create visual separation between blocks of content.

Browsers normally display paragraphs as block-level content with space before or after them. The amount of spacing can be controlled with CSS instead of inserting empty paragraphs or line breaks.

A paragraph can contain phrasing content such as links, emphasized text, images, and other inline content, but it cannot contain block-level structures such as headings, lists, sections, or another paragraph.

The closing </p> tag can be omitted in certain situations allowed by HTML parsing rules, but including it generally makes source code easier to read and maintain.

Accessibility

Using <p> elements for actual paragraphs gives written content a meaningful structure that browsers and assistive technologies can interpret consistently.

Keep related sentences together within the same paragraph and begin a new paragraph when the subject or idea changes. Do not use empty <p> elements to create visual spacing; use CSS margins or padding instead.

Browser Support

Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.

For detailed browser compatibility information, see Can I Use: HTML <p> Element .

The <p> element is related to the <br> element for line breaks, the <h1> through <h6> elements for headings, the <blockquote> element for extended quotations, and the <div> element for grouping content.

Specifications

HTML Living Standard: The <p> Element