Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<p>

A paragraph of text.

Syntax

<p>Paragraph text</p>

Examples

Two paragraphs — the browser adds space between them:

<p>Our coffee shop opened in 2015.</p>
<p>Today we roast our own beans every week.</p>

The space between paragraphs is set in CSS:

<style>
  p { margin: 0 0 4px; line-height: 1.6; }
</style>
 
<p>First paragraph with tighter spacing.</p>
<p>Second paragraph right below.</p>

Notes

A <p> may contain only text and inline elements (<a>, <strong>, <span>…). Blocks like <div>, <ul> or another <p> are not allowed inside — the browser closes the paragraph early. Do not use empty paragraphs for spacing: set the distance with margin.

See also

  • <h1>–<h6> — Headings of six levels: `<h1>` is the main one, `<h6>` the smallest.
  • <br> — A line break inside text; `<wbr>` marks where a line may break if space runs out.
  • <strong> — Important text; shown in bold by default.
  • <span> — An inline container without meaning: used to style part of a text.

Related recipes

In the tutorial

  • Headings and paragraphs — Six levels of headings, paragraphs, spaces and line breaks, the thematic break and quotes in HTML.

Thanks for reading!

Donate to the site — we work hard for you.