HTML Paragraphs Guide

Proper use of paragraphs and text formatting in HTML

<p>

The standard paragraph element for blocks of text

Usage: Primary element for textual content

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

<br>

Line break within text (use sparingly)

Usage: For intentional line breaks within content

<p>First line<br>Second line</p>

<pre>

Preformatted text preserving whitespace

Usage: Code blocks or text requiring exact formatting

<pre>function hello() { console.log("Hello"); }</pre>

<blockquote>

Block quotation from another source

Usage: Extended quotations with citation

<blockquote cite="https://example.com"> <p>This is a quoted passage.</p> </blockquote>

<hr>

Thematic break between content sections

Usage: Visual separation between content areas

<p>First section</p> <hr> <p>Second section</p>

<strong>

Important text (typically bold)

Note: Semantic importance, not just visual styling

<p>This is <strong>important</strong> text.</p>

<em>

Emphasized text (typically italic)

Note: For verbal emphasis, not just visual styling

<p>Please <em>read carefully</em>.</p>

<mark>

Highlighted text for reference

Note: Like using a highlighter on paper

<p>The <mark>key point</mark> is highlighted.</p>

<small>

Side comments and fine print

Note: For legally required disclaimers etc.

<p>Main content <small>Additional notes</small></p>

<code>

Inline code snippets

Note: For short code references in text

<p>Use <code>console.log()</code> for debugging.</p>

Semantic Structure

Use paragraph elements for text content rather than generic containers

Good Example
Bad Example

Line Breaks

Avoid excessive <br> tags for spacing - use CSS margins instead

Good Example
Bad Example

Text Formatting

Use semantic elements rather than styling elements directly

Good Example
Bad Example

Accessibility

Ensure proper contrast and readable line lengths

Good Example
Bad Example

Article Content

Technical Documentation

Accessible Content

Paragraphs Playground

Experiment with paragraph formatting in our live editor

Paragraph Examples Preview

Ready-to-use examples covering proper paragraph usage

Live Preview

Proper Paragraph Structure

This is a properly structured paragraph with appropriate line length and spacing. The content flows naturally and is easy to read.

Subsequent paragraphs are separated by appropriate margins, creating a comfortable reading rhythm without excessive space.

Semantic Formatting

This paragraph contains important text and emphasized content using semantic HTML elements.

Technical terms like console.log() are marked up properly, and key points are highlighted for emphasis.

All examples will be loaded into an interactive editor where you can modify and test them

Continue Learning