HTML

HTML Paragraph Tag โ€“ Complete Guide with Examples

Apr 30, 2025, 10:41 AM
Blog Thumbnail

๐Ÿ”น What is the <p> Tag, And Its Uses?

<p> Tag in HTML is used to define a single paragraph. Since it is a block-level element, it adds a margin to the spacing on all four sides, which helps in the readability of your content.

This is a paragraph of text.

๐Ÿง  Key Features

  • Block level element.
  • It will give you a default top and bottom margin.
  • You cannot add block elements such as <div>, <section>, etc.
  • It must be closed with </p>.

๐Ÿงช Examples

โœ… Simple Paragraph

This is a basic paragraph.

โœ… Paragraph with Formatting

This is bold and italic.

โœ… With Line Break

Line one.
Line two.

โŒ Incorrect Usage

Invalid paragraph placeholder
block inside

โš ๏ธ Block elements like <div> should not be placed inside a paragraph tag.

๐ŸŽจ Styling with Tailwind

You can easily manage the style of your paragraphs using Tailwind, by creating a p tag with the css class; โ€œtext-lg leading-relaxedโ€

This is a styled paragraph using Tailwind

As a placeholder for a Tailwind styled paragraph.

๐Ÿ“Œ Best Practices

  • You can use one <p> tag for a single idea or section of content.
  • Never place block elements inside a paragraph tag.