Complete the code to create a paragraph with the text "Hello, world!".
<[1]>Hello, world!</[1]>
will work but is not semantic for paragraphs.
tags are used to create paragraphs in HTML. Using
will display the text as a paragraph.
Complete the code to add a paragraph with the text "Welcome to my website." inside the main section.
<main> <[1]>Welcome to my website.</[1]> </main>
for paragraph text.
tag is used to define paragraphs inside sections like
Fix the error in the paragraph tag to correctly display the text "This is a paragraph.".
<p>This is a paragraph.[1]</p>tag inside a paragraph is invalid.
inserts a line break inside the paragraph if needed.
Fill both blanks to create two paragraphs inside a section.
<section> <[1]>First paragraph.</[1]> <[2]>Second paragraph.</[2]> </section>
for paragraphs.
tags for both paragraphs to semantically mark them as paragraphs.
Fill all three blanks to create a paragraph with emphasized and strong text inside.
<p>This is a [1] paragraph with [2] and [3] text.</p>
Practice
Solution
Step 1: Understand paragraph tags
The<p>tag is specifically designed to create paragraphs in HTML.Step 2: Compare with other tags
<div>and<section>are for grouping content,<span>is inline, not for paragraphs.Final Answer:
<p> -> Option AQuick Check:
Paragraph tag = <p> [OK]
- Using <div> instead of <p>
- Using <span> for paragraphs
- Confusing <section> with paragraph
Solution
Step 1: Check opening and closing tags
The paragraph tag must open with<p>and close with</p>.Step 2: Validate the options
<p>Hello World</p>correctly opens and closes the paragraph tag. Options A and B have missing closing brackets, and C uses an invalid tag.Final Answer:
<p>Hello World</p> -> Option AQuick Check:
Proper tag syntax = <p>text</p> [OK]
tags properly with
[OK]- Missing closing > in tags
- Using invalid tag names
- Forgetting closing tag
<p>First paragraph.</p> <p>Second paragraph.</p>
Solution
Step 1: Understand paragraph rendering
Each<p>tag creates a block with space above and below, so paragraphs appear separated by blank lines.Step 2: Analyze the output
The browser shows "First paragraph." then a blank line, then "Second paragraph." on the next line.Final Answer:
First paragraph.\n\nSecond paragraph. -> Option BQuick Check:
Paragraphs add vertical space = separate lines [OK]
- Thinking paragraphs run together without space
- Ignoring line breaks
- Confusing inline and block elements
<p>This is a paragraph. <p>This is another paragraph.</p>
Solution
Step 1: Check paragraph tag pairs
The first<p>tag is not closed before the second<p>starts.Step 2: Understand paragraph rules
Paragraph tags must be properly closed; missing closing tags cause rendering issues.Final Answer:
Missing closing tag for the first paragraph -> Option CQuick Check:
Eachneeds a closing
[OK]
- Forgetting tags
- Thinking <p> can self-close
- Confusing <p> with <div>
Solution
Step 1: Structure paragraphs correctly
Each paragraph must be enclosed in its own<p>tags.Step 2: Use inline tags inside paragraphs
The<em>tag is used inside the second paragraph to italicize text properly without breaking HTML rules.Step 3: Check invalid nesting
Options C and D incorrectly nest block and inline tags, and B puts all text in one paragraph.Final Answer:
<p>First paragraph.</p><p><em>Second paragraph.</em></p><p>Third paragraph.</p> -> Option DQuick Check:
Use <p> for paragraphs and <em> inside for emphasis [OK]
- Nesting <p> inside <em>
- Not closing tags properly
- Putting all text in one paragraph
Ready to prove it?
Pass the test and this pattern moves unknown
