Codectionary / Developer documentation / HTML

<p>

The <p> element represents a paragraph of text — one of the most fundamental building blocks of written content on the web. Browsers automatically add margin above and below paragraphs to visually separate them. The <p> element cannot contain other block-level elements like <div> or headings, only inline content and text. It is a block-level element, meaning it always starts on a new line.

Syntax

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

Examples

Basic Paragraph

A simple paragraph of body text.

<p>HTML provides the structure for every web page. Without it, browsers would have no way to understand how content should be organized.</p>

Multiple Paragraphs

Separating distinct ideas into individual paragraphs.

<p>The first paragraph introduces the topic.</p>
<p>The second paragraph builds on that idea with more detail.</p>
<p>A closing paragraph wraps up the thought.</p>

Paragraph with Inline Elements

Combining a paragraph with inline formatting like links and emphasis.

<p>Learn more about <strong>semantic HTML</strong> by reading the <a href="/docs/html">official documentation</a>. It really <em>does</em> make a difference.</p>

Best practices

  • Use <p> for actual paragraphs of text, not for spacing or layout purposes
  • Never nest block-level elements like <div> or <h1> inside a <p> — browsers will auto-close the paragraph
  • Use CSS margin/padding to control spacing rather than empty paragraphs or multiple <br> tags
  • Keep paragraphs focused on a single idea for better readability

Browser compatibility

Support applies to the named feature, not every attribute or behaviour in this article. Versions refer to browsers, not operating systems.

<p>

Desktop

Chrome
Supported
From 1
Firefox
Supported
From 1
Safari
Supported
From 1
Edge
Supported
From 12
Opera
Supported
From 15

Mobile

Safari on iOS
Supported
From 1
Chrome for Android
Supported
From 18
Firefox for Android
Supported
From 4
Samsung Internet
Supported
From 1.0

MDN BCD record for this feature · MDN reference

Support history and limitations

Chrome

  • From 1

Firefox

  • From 1

Safari

  • From 1

Edge

  • From 12

Opera

  • From 15

Safari on iOS

  • From 1

Chrome for Android

  • From 18

Firefox for Android

  • From 4

Samsung Internet

  • From 1.0

MDN BCD 8.1.5 · Dataset built 2026-10-08 · Mapping reviewed 2026-10-21. These dates are not individual browser-test or claim-verification dates. Unknown means the data does not establish support.

HTML Living Standard

Specifications & further reading