p – paragraph

<p>Paragraph text.</p>

A paragraph – the basic block of text. The browser gives it a margin at the top and bottom (1em), so paragraphs are separated by a gap. Only phrasing content may be inside: text, links, emphasis, images, not other blocks.

  • Default display: display: block
  • End tag: can be omitted – the paragraph is ended by the start of another block (p, div, ul, a heading…) or by the end of its parent
  • Content: phrasing content (text, a, strong, em, img, br…)
  • Where it can be used: anywhere flow content is allowed
  • DOM interface: HTMLParagraphElement

Attributes

Only global attributes (the obsolete align is replaced by CSS text-align).

Examples

Two paragraphs – the gap between them is the default margin:

<p>Prepare the starter a day in advance and leave it somewhere warm overnight.</p>
<p>In the morning mix the starter with flour, water and salt and let the dough rise for <strong>4 hours</strong>.</p>
result

Prepare the starter a day in advance and leave it somewhere warm overnight.

In the morning mix the starter with flour, water and salt and let the dough rise for 4 hours.

A block inside a paragraph does not work – the browser ends the paragraph before the div and turns the </p> at the end into a new empty paragraph:

<p>Introduction
  <div>A block inside a paragraph</div>
</p>

The browser builds <p>Introduction</p><div>A block inside a paragraph</div><p></p> from it.

Things to watch out for

  • Do not use empty paragraphs (<p>&nbsp;</p>) as spacing between blocks – screen readers announce them as a blank line. Set the spacing in CSS with margin.
  • A div, a list, a table or a heading does not belong in a paragraph – the paragraph ends before them. Wrap text and images in a block in a div.
  • br breaks a line inside a paragraph; a new paragraph, however, is always a new p.

Browser support

Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1. As of October 2026 (MDN browser-compat-data).

Related:
div – generic block
br – line break
h1–h6 – headings
pre – preformatted text
blockquote – block quotation