HTML Paragraphs

HTML Paragraphs are used to display blocks of text on a web page.
They help organize content into readable sections.

In this tutorial, you will learn how to create paragraphs, how spacing works, and see examples with output.

What Are HTML Paragraphs

HTML paragraphs are defined using the <p> tag.

They are used to:

  • Display text content
  • Separate blocks of text
  • Improve readability

HTML Paragraph Syntax

Example

<p>This is a paragraph.</p>

Explanation

PartDescription
<p>Opening tag
ContentText inside paragraph
</p>Closing tag

HTML paragraphs, paragraph tag HTML, HTML p tag, HTML text formatting, HTML basics


Basic Paragraph Example

Example Code

<p>This is my first paragraph.</p>
<p>This is my second paragraph.</p>

Output

This is my first paragraph.

This is my second paragraph.


HTML Automatically Adds Space

HTML automatically adds space before and after paragraphs.

Example Code

<p>First paragraph</p>
<p>Second paragraph</p>

Output

First paragraph

Second paragraph


HTML Ignores Extra Spaces

HTML ignores extra spaces and line breaks in code.

Example Code

<p>
This is a paragraph
with extra spaces.
</p>

Output

This is a paragraph with extra spaces.


Line Break Inside Paragraph

To break a line, use <br> tag.

Example Code

<p>This is line one.<br>This is line two.</p>

Output

This is line one.
This is line two.


Horizontal Line with Paragraph

You can separate content using <hr>.

Example Code

<p>Paragraph one</p>
<hr>
<p>Paragraph two</p>

Output

Paragraph one


Paragraph two


Styling Paragraphs

Example Code

<p style="color: blue;">This is a styled paragraph.</p>

Output

This is a styled paragraph. (in blue color)


Aligning Paragraph Text

Example Code

<p style="text-align: center;">Centered paragraph</p>

Output

Centered paragraph (center aligned)


HTML Paragraph vs Heading

Comparison Table

FeatureParagraphHeading
Tag<p><h1> to <h6>
PurposeText contentTitles
ImportanceNormalHigh

Common Mistakes with Paragraphs

MistakeResult
Missing closing tagFormatting issues
Using <br> too muchPoor readability
Adding extra spacesIgnored by browser
Using paragraphs as headingsWrong structure

Multiple Paragraph Example

Example Code

<h1>About HTML</h1><p>HTML is used to create web pages.</p><p>It is easy to learn and widely used.</p>

Output

About HTML

HTML is used to create web pages.

It is easy to learn and widely used.


Internal Backlinks for phponline.in

This page can link to:

  • HTML Headings
  • HTML Text Formatting
  • HTML Tags
  • HTML Elements

Frequently Asked Questions (FAQ)

1. What is a paragraph in HTML?

A paragraph is a block of text defined using the <p> tag.

2. Does HTML support multiple paragraphs?

Yes, you can create multiple paragraphs using multiple <p> tags.

3. How do I add a line break?

Use the <br> tag.

4. Does HTML keep extra spaces?

No, HTML ignores extra spaces.

5. Can I style paragraphs?

Yes, using CSS or the style attribute.

Related Article
Introduction to HTML

HTML Introduction – Learn the Basics of HTML HTML is the starting point of web development. Every website you see Read more

What is HTML

What Is HTML – Complete Beginner Explanation HTML is the foundation of the web. Every website you visit, from simple Read more

HTML Basic Examples

HTML Basic Examples – Learn HTML by Practice The best way to learn HTML is by writing and testing simple Read more

HTML text Editors

HTML Text Editors – Learn How to Write HTML Code To write HTML code, you need a text editor. A Read more

HTML Tags

HTML Tags are the basic units used to create HTML elements.They define how content is displayed in a web browser. Read more

HTML Elements

HTML Elements are the building blocks of every web page.Each element defines a part of the webpage, such as headings, Read more

HTML Attributes

HTML Attributes provide additional information about HTML elements.They help control how elements behave, display, or store extra data. In this Read more

HTML Headings

HTML Headings are used to define titles and subtitles on a web page.They help organize content and improve readability for Read more