HTML <p> Tag
Description
The HTML <p> element represents a paragraph of text. It is one of the most basic and commonly used HTML elements.
Browsers automatically add some margin before and after each <p> element. Paragraphs are block-level elements, meaning each one starts on a new line.
CSS Display:
blockSyntax
<p>Your paragraph text here.</p>Popular Attributes
| Attribute | Description |
|---|---|
| id | A unique identifier for the element. Used for CSS styling, JavaScript targeting, and anchor links. |
| class | Specifies one or more CSS class names for styling the element. |
| style | Applies inline CSS styles directly to the element. |
This element also supports global HTML attributes such as class, id, style, data-*, and more.
Examples
Basic Paragraph
<p>This is a basic paragraph of text. It demonstrates how the p element works in HTML.</p>
A simple paragraph of text.
Multiple Paragraphs
<p>This is the first paragraph. It introduces the topic.</p>
<p>This is the second paragraph. Notice the automatic spacing between paragraphs.</p>
Multiple paragraphs automatically have spacing between them.
Notes
The <p> element cannot contain block-level elements like <div>, <h1>–<h6>, or other <p> tags. If you place a block element inside a paragraph the browser will automatically close the paragraph.
Related Tags
Last updated: 7th April 2026