Level:Beginner

HTML Paragraphs

The <p> element is used for normal text content on web pages. Paragraphs create readable blocks of text and automatically include spacing between them.

What is a Paragraph in HTML?

  • A paragraph is a block of text wrapped inside <p> and </p>.
  • The <p> element is a block-level element, meaning it starts on a new line and takes up the full available width.
  • Browsers add default spacing (margin) between paragraphs to make text easier to read.

Paragraph vs Line Break

  • Use <p> when you are starting a new idea or new block of text.
  • Use <br> for a line break inside the same paragraph (like addresses or poems).
  • A common beginner mistake is using lots of <br> tags for spacing. Prefer paragraphs + CSS for layout.

Best Practices

  • Keep paragraphs short (2–4 lines) for readability, especially on mobile.
  • Do not place block elements like <div> or headings inside <p>. A paragraph should contain text and inline elements (like <a>, <strong>, <em>).
  • Use semantic structure: headings for section titles, paragraphs for section text.

Paragraph Example

HTML Paragraph Examplehtml
<!-- A paragraph is a block of text -->
<p>Paragraph</p>

<p>
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Delectus eveniet
  accusamus iure officiis in reprehenderit itaque dolorum ratione qui nostrum.
</p>

<!-- Use <br> for a line break inside the SAME paragraph -->
<p>
  This is one paragraph with a line break.<br />
  This text appears on the next line but is still the same paragraph.
</p>

Preview

localhost:3000
Loading preview...