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.


HTML Paragraphs Quiz

Q1: Which tag is used to define a paragraph in HTML?

A. <para>
B. <pg>
C. <p>
D. <paragraph>

Q2: What does the <br> tag do?

A. Creates a new paragraph
B. Boldens text
C. Inserts a line break
D. Adds a horizontal line

Q3: How does HTML treat extra white spaces in paragraphs?

A. Renders all of them
B. Converts to bullet points
C. Ignores extra spaces
D. Converts them to tabs

Q4: Which tag should be used for spacing within a paragraph?

A. <space>
B. &nbsp;
C. <tab>
D. <div>

Q5: What type of element is <p>?

A. Inline
B. Container
C. Block-level
D. Special

Q6: What is the default display of a <p> tag?

A. Inline with no margin
B. Block with margin
C. Hidden
D. Inline-block

Q7: Which of the following will insert a line break?

A. <p>
B. <break>
C. <br>
D. <line>

Q8: Which attribute allows you to style a paragraph directly?

A. font
B. css
C. style
D. class

Q9: What happens if you write multiple <p> tags in a row?

A. They will overlap
B. Only the last one shows
C. Each will display on a new line
D. The browser crashes

Go Back Top