HTML Paragraphs


🔹 What is an HTML Paragraph?

In HTML, a paragraph is defined using the <p> tag. It is used to display a block of text with spacing above and below.

👉 Basic Syntax:
<p>This is a paragraph.</p>

Browsers automatically add space before and after a paragraph to separate it from other elements.


🔹 Example:
<p>HTML is the standard markup language for creating web pages.</p>
<p>It is easy to learn and widely used.</p>

Each <p> tag starts a new paragraph on the page.


🔹 Multiple Paragraphs

You can create multiple paragraphs by writing multiple <p> tags:

<p>Paragraph one: Introduction to HTML.</p>
<p>Paragraph two: HTML elements and attributes.</p>

🔹 Line Breaks Inside a Paragraph

Use the <br> tag to break a line without starting a new paragraph.

<p>First line.<br>Second line in same paragraph.</p>

📌 <br> is an empty element and does not require a closing tag.


🔹 White Space Handling

HTML ignores extra spaces and line breaks. Even if you press Enter multiple times in the editor, the browser treats it as a single space.

<p>This          is          spaced.</p>

Output: This is spaced.

To control space/line breaks, use:

  • <br> – line break

  • &nbsp; – non-breaking space


🔹 Styling Paragraphs

You can style paragraphs using the style attribute:

<p style="color: blue; font-size: 18px;">Styled paragraph text.</p>

Practice Questions

Q1. Write a basic paragraph using the <p> tag.

Q2. Create two paragraphs describing HTML and CSS.

Q3. Insert a line break within a paragraph using <br>.

Q4. Add inline style to a paragraph to change text color to green.

Q5. Create a paragraph with a font size of 20px using the style attribute.

Q6. Display three paragraphs about your hobbies.

Q7. Add a paragraph that includes bold text using <strong>.

Q8. Insert multiple spaces in a paragraph and observe the output.

Q9. Use &nbsp; to add extra spacing in a sentence.

Q10. Create a paragraph with a line break and color it red.


Go Back Top