Path // www.yourhtmlsource.comReference → <p>

<p>


The <p> element represents a paragraph of text. It is the fundamental building block for text content in HTML documents, creating a logical block of related sentences that forms a complete thought or idea.

Clock This page was last updated on 2025-11-27



Syntax

<p>Your paragraph text here.</p>

Attributes

  • class - CSS class name for styling
  • id - Unique identifier for the element
  • style - Inline CSS styles
  • title - Advisory information (tooltip)
  • lang - Language of the content
  • dir - Text direction (ltr or rtl)

Examples

Basic paragraph:

<p>This is a simple paragraph containing a single thought or idea.</p>

Multiple paragraphs:

<p>First paragraph introduces the topic.</p>
<p>Second paragraph expands on the idea.</p>
<p>Third paragraph concludes the discussion.</p>

Paragraph with inline elements:

<p>This paragraph contains <strong>important text</strong> and <em>emphasized words</em>.</p>

When to Use

Use the <p> element for any block of text that represents a complete thought or paragraph. This includes article content, descriptions, explanations, and general prose. Do not use <p> for structural grouping (use <div>), for lists (use <ul> or <ol>), or for headings (use <h1>-<h6>).

Browsers automatically add margin space above and below paragraphs, creating visual separation between blocks of text. The closing </p> tag is technically optional but should always be included for clarity and valid markup.

Related Elements