Paragraphs are the foundation of text content on any webpage.
In HTML, the<p>tag is used to define a paragraph — separating blocks of text and improving readability for both users and browsers.
What Is an HTML Paragraph?
An HTML paragraph is created using the <p> element.
Browsers automatically add space before and after each paragraph to make text easier to read.
<p>This is my first paragraph.</p>
<p>This is another paragraph with more text.</p>Each paragraph is treated as a separate block of content.
How Browsers Handle Paragraphs
- Browsers ignore extra spaces or line breaks inside a paragraph.
- Even if you press Enter or add multiple spaces, HTML will display them as a single space.
<p>This
is one
paragraph.</p>Output
This is one paragraph.
💡 To create actual line breaks, use the <br> tag (explained later).
Paragraph Styling with CSS
<p style="color: #29AB87; font-size: 18px; line-height: 1.6;">
HTML paragraphs make your text organized and easy to read.
</p>Common properties to style paragraphs:
color— text colorfont-size— size of textline-height— spacing between linestext-align— alignment (left,center,right,justify)
Aligning Text in Paragraphs
<p style="text-align:center;">This paragraph is centered.</p>
<p style="text-align:right;">This paragraph is aligned to the right.</p>
<p style="text-align:justify;">This paragraph is justified like in newspapers.</p>Alignment improves presentation and helps with layout design.
Nested Elements Inside Paragraphs
You can include inline elements (formatting tag) such as <b>, <i>, <strong>, <em>, or <a> inside paragraphs.
<p>HTML <strong>paragraphs</strong> can include <em>formatted text</em> and <a href="#">links</a>.</p>Things to Remember
- Paragraphs cannot contain block-level elements (like
<div>or<h1>). - Always close the paragraph tag (
</p>). - Avoid leaving empty
<p></p>tags — they create unwanted space.
Conclusion
HTML paragraphs structure your text and make your web content clean, readable, and accessible.
Use them properly to separate ideas, add spacing, and create a natural reading flow for visitors.