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>
In Chinese, Japanese and Korean text (:lang(zh), :lang(ja), :lang(ko)) the indent is exactly one full-width character (1em), following the CJK convention. p.lead in those languages keeps the CJK body leading of 1.8 instead of the Latin --line-height-relaxed.
Drop Cap
Add data-drop-cap to a single paragraph to give it a large decorative initial letter. It uses initial-letter: 3 where supported, with a floated fallback. To put the drop cap on an article's opening paragraph automatically, set data-drop-cap on the <article> instead — see the article page.
<p data-drop-cap>Once upon a time, in a kingdom bythe sea, there lived a cartographer who mappedonly the places nobody had visited yet.</p>
The enlarged letter is decorative: screen readers still read the word as written.
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>
Language required: hyphens: auto only hyphenates when the paragraph (or an ancestor, usually <html>) has a lang attribute the browser has a hyphenation dictionary for. Without it the text is justified but not hyphenated, so expect wider word gaps.
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 readers (default settings) |
<strong> |
Importance, seriousness, urgency |
Conveys semantics; most screen readers do not announce it by default |
<b> |
Stylistic bold (keywords, product names) |
Not announced |
<em> |
Stress emphasis |
Conveys semantics; most screen readers do not announce it by default |
<i> |
Alternative voice (terms, thoughts) |
Not announced |
<small> |
Side comments, fine print |
Normal reading |
<mark> |
Highlighted for reference |
Some readers announce it, often only with verbose settings |
Never rely on emphasis alone to carry meaning that matters (a warning, a required step): with default settings, most screen readers read <strong> and <em> in the normal voice. Put the meaning in the words.
Nested Emphasis
Italic inside an italic context toggles back to upright (the classic emphasis toggle), so <em> inside <em>, a <blockquote>, <cite>, <dfn> or <var> still shows a difference. Nested <strong><em> renders as true bold-italic.
CSS Properties
The paragraph rules from src/native-elements/paragraph/styles.css (the same file also styles strong, b, em, i, small and mark — see each element's page). The CJK lead leading lives in src/native-elements/i18n/styles.css; the drop cap in src/native-elements/article/styles.css.
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.indent:is(:lang(zh), :lang(ja), :lang(ko)) { text-indent: 1em;} p.justify { text-align: justify; hyphens: auto; -webkit-hyphens: auto;} p.lead:is(:lang(zh), :lang(ja), :lang(ko)) { line-height: 1.8;}
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 (needs lang) |
p[data-drop-cap] |
Large decorative initial letter |
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 each paragraph as a separate block of content. In browse mode, most screen readers let users move between paragraphs with a keyboard command (for example, P in NVDA and JAWS). Paragraph styling such as .lead, .indent or data-drop-cap is visual only and is not announced.
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.