- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <p> Tag
HTML Tags
HTML <p> Tag
The
<p>tag defines a paragraph of text in HTML.
It is a block-level element that automatically adds some spacing above and below the text, making content readable and organized.
Syntax
html
<p>This is a paragraph of text.</p>Attributes
| Attribute | Description |
|---|---|
| class | Assigns one or more class names for styling. |
| id | Assigns a unique identifier to the paragraph. |
| style | Adds inline CSS styles. |
| title | Provides additional information as a tooltip. |
Example
html
<p>This is the first paragraph on the page.</p>
<p>This is the second paragraph, which is separated from the first by default spacing.</p>Output
Browser Output
html
Use our TryIt Editor to see the output.Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Paragraphs are block-level elements that display text with spacing above and below. Multiple paragraphs are automatically separated for readability.
Notes
- The
<p>tag is a block-level element, so it starts on a new line and extends the full width of its container. - Avoid placing block-level elements like
<div>or<h1>inside<p>tags. - Use CSS to style paragraphs (color, font, spacing, alignment).
- Multiple
<p>tags create distinct blocks of text on the page.
Conclusion
The <p> tag is the standard way to display paragraphs in HTML.
It provides readable and well-structured text content, which is essential for both users and search engines.
