Learn HTML – Part 8 – Paragraph Tag – p Tag Explained
The HTML p tag is used to create paragraphs on a webpage. Paragraphs help organize text content and improve readability.
Most textual content on websites is written using paragraph elements.
What is the Paragraph Tag?
The p tag stands for paragraph. It defines a block of text separated from other content.
Browsers automatically add spacing before and after paragraphs to make the content easier to read.
Basic Syntax
<p>This is a paragraph.</p>
Example – Creating Paragraphs
<p>HTML is the foundation of web development.</p>
<p>It is used to structure content on web pages.</p>
Output:
HTML is the foundation of web development.
It is used to structure content on web pages.
Automatic Spacing in Paragraphs
Browsers automatically add margin space above and below each paragraph.
This helps separate blocks of text visually.
Paragraph vs Line Break
| Feature | p Tag | br Tag |
|---|---|---|
| Purpose | Creates a paragraph | Creates a line break |
| Spacing | Adds vertical spacing | No extra spacing |
| Usage | Blocks of text | Short line breaks |
Example – Paragraph with Line Break
<p>
HTML is used to structure web pages.<br>
CSS is used to style them.
</p>
Output:
HTML is used to structure web pages.
CSS is used to style them.
Common Mistakes Beginners Make
- Using multiple
brtags instead of paragraphs - Forgetting to close the
ptag - Placing block elements inside paragraphs incorrectly
Use paragraphs to organize content into readable blocks.
Conclusion
The HTML p tag is used to create paragraphs and structure text content on a webpage.
It improves readability and helps organize information clearly for users.
What’s Next?
Now that you understand the p tag, the next step is learning about the hr tag, which is used to create horizontal lines to separate sections of content.
Next: Learn HTML – Part 9 – Horizontal Line Tag – hr Tag Explained →
Series: Learn HTML Series
