-
Hajipur, Bihar, 844101
In HTML, a paragraph is defined using the <p>
tag. It is used to display a block of text with spacing above and below.
<p>This is a paragraph.</p>
Browsers automatically add space before and after a paragraph to separate it from other elements.
<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.
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>
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.
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
– non-breaking space
You can style paragraphs using the style
attribute:
<p style="color: blue; font-size: 18px;">Styled paragraph text.</p>
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
to add extra spacing in a sentence.
Q10. Create a paragraph with a line break and color it red.
Q1: Which tag is used to define a paragraph in HTML?
Q2: What does the <br> tag do?
Q3: How does HTML treat extra white spaces in paragraphs?
Q4: Which tag should be used for spacing within a paragraph?
Q5: What type of element is <p>?
Q6: What is the default display of a <p> tag?
Q7: Which of the following will insert a line break?
Q8: Which attribute allows you to style a paragraph directly?
Q9: What happens if you write multiple <p> tags in a row?