p
The paragraph element represents a block of text, forming the basic building block of written content on the web.
Overview
The <p> element is used for blocks of text content. It automatically creates vertical spacing between adjacent paragraphs and uses modern CSS text-wrap features for optimal readability.
<p>This is a paragraph of text. Paragraphs have propertext wrapping that avoids orphaned words at the endof lines when possible.</p> <p>A second paragraph shows the vertical rhythm betweenadjacent paragraphs.</p>
When to Use
- Body text — For regular prose and explanatory content
- Descriptions — Product descriptions, summaries, introductions
- Lead paragraphs — Opening text that introduces a section
- Form help text — Explanatory text near form controls
When Not to Use
- For single words or phrases (use
<span>instead) - For items in a sequence (use
<ul>or<ol>) - For code snippets (use
<code>or<pre>) - For quoted text (use
<blockquote>)
Lead Paragraph
Use the .lead class to create an introductory paragraph with larger, muted text. Commonly used as the opening paragraph of an article or section.
<p class="lead">This is a lead paragraph that introducesthe main content. It has larger text and muted colorto distinguish it from regular body text.</p> <p>This is a regular paragraph that follows.</p>
Balanced Text
The .balance class applies text-wrap: balance, which distributes text evenly across lines. Ideal for short, centered text like hero subtitles or card descriptions.
<h2>Welcome to Vanilla Breeze</h2><p class="balance">A design system built on native HTMLelements, semantic CSS, and zero JavaScriptdependencies.</p>
Note: Browsers limit text-wrap: balance to roughly 6 lines of text. For longer paragraphs, the default text-wrap: pretty is more appropriate.
Indented Paragraphs
The .indent class adds a book-style first-line indent. When consecutive indented paragraphs follow each other, the inter-paragraph margin collapses to zero, creating traditional prose formatting.
<p class="indent">The morning light crept through theshutters, casting thin stripes across the woodenfloor.</p><p class="indent">Outside, the first birds had begun tocall. It was the kind of quiet that felt intentional.</p><p class="indent">She stood, finally, and crossed to thewindow. The garden was still wet with dew.</p>
Justified Text
The .justify class aligns text to both edges and enables automatic hyphenation. This produces the polished look seen in books and newspapers. Works best in narrow columns (40-60ch).
<p class="justify">Typography is the art and techniqueof arranging type to make written language legible,readable, and appealing when displayed.</p>
Accessibility note: The a11y-dyslexia theme automatically overrides p.justify to left-aligned text with no hyphenation, ensuring readability for users with dyslexia.
Text Emphasis
Paragraphs can contain inline elements for emphasis and semantic meaning.
<p>Use <strong>strong</strong> for importance.Use <b>bold</b> for stylistic emphasis.</p> <p>Use <em>em</em> for stress emphasis.Use <i>italic</i> for alternative voice.</p> <p>Price: $99.99 <small>(plus tax)</small>.</p> <p>Search results can <mark>highlight</mark>matching terms.</p>
Choosing the Right Element
| Element | Meaning | Screen Reader |
|---|---|---|
<strong> |
Importance, seriousness, urgency | Announced differently |
<b> |
Stylistic bold (keywords, product names) | Not announced |
<em> |
Stress emphasis (spoken differently) | Announced differently |
<i> |
Alternative voice (terms, thoughts) | Not announced |
<small> |
Side comments, fine print | Normal reading |
<mark> |
Highlighted for reference | Some readers announce |
CSS Properties
p { text-wrap: pretty;} p + p { margin-block-start: var(--size-m);} p.lead { font-size: var(--font-size-xl); line-height: var(--line-height-relaxed); color: var(--color-text-muted);} p.balance { text-wrap: balance;} p.indent { text-indent: 1.5em;} p.indent + p.indent { margin-block-start: 0;} p.justify { text-align: justify; hyphens: auto; -webkit-hyphens: auto;} strong, b { font-weight: 600;} em, i { font-style: italic;} small { font-size: var(--font-size-sm);} mark { background: oklch(from var(--color-interactive) l c h / 0.2); padding-inline: var(--size-2xs); border-radius: var(--radius-s);}
Variant Summary
| Class | Purpose |
|---|---|
p.lead |
Larger, muted intro paragraph |
p.balance |
Even line distribution for short, centered text |
p.indent |
Book-style first-line indent with collapsed margins |
p.justify |
Justified alignment with auto-hyphenation |
Accessibility
Best Practices
- Semantic structure — Use paragraphs for actual paragraph content, not for layout spacing
- Reading level — Write at an appropriate reading level for your audience
- Line length — Keep lines to 45-75 characters for optimal readability
- Contrast — Ensure sufficient color contrast with the background
Screen Reader Behavior
Screen readers treat paragraphs as distinct blocks of content. Users can navigate between paragraphs using keyboard shortcuts and hear a pause between them to indicate the break.
Dyslexia Theme
The a11y-dyslexia theme overrides p.justify to use left-aligned text and disables hyphenation. The .lead, .balance, and .indent classes remain unaffected since they don't interfere with readability.
Related
<h1>-<h6>— Headings that introduce paragraph content<blockquote>— For quoted text blocks<ul>,<ol>— For lists of items- Inline semantics — Elements like
<abbr>,<cite>,<dfn>