📖 Scenario: You are creating a simple webpage paragraph that highlights certain words using inline elements. Inline elements let you style or emphasize parts of text without breaking the flow.
🎯 Goal: Build a paragraph using inline HTML elements: <em> for emphasis, <strong> for strong importance, and <code> for code snippets.
📋 What You'll Learn
Create a paragraph with the exact text: "This is an example of inline elements: emphasis, strong importance, and code."
Wrap the word "emphasis" with the <em> tag.
Wrap the words "strong importance" with the <strong> tag.
Wrap the word "code" with the <code> tag.
Use semantic HTML5 structure with <main> and <section>.
💡 Why This Matters
🌍 Real World
Inline elements are used every day in webpages to emphasize text, show code snippets, or highlight important information without breaking the paragraph flow.
💼 Career
Knowing how to use inline HTML elements correctly is essential for web developers to create accessible, semantic, and well-structured content.
Progress0 / 4 steps
1
Create the basic HTML structure with a paragraph
Write the basic HTML5 skeleton with lang="en", charset="UTF-8", and a <main> element containing a <section> with a paragraph. The paragraph text must be exactly: "This is an example of inline elements: emphasis, strong importance, and code."
HTML
Hint
Start with the basic HTML5 page structure. Put the paragraph inside <main> and <section>.
2
Add <em> tag around the word 'emphasis'
Inside the paragraph, wrap the word emphasis with the <em> tag to show emphasis.
HTML
Hint
Use the <em> tag exactly around the word emphasis inside the paragraph.
3
Add <strong> tag around 'strong importance'
In the paragraph, wrap the words strong importance with the <strong> tag to show strong importance.
HTML
Hint
Use the <strong> tag exactly around the words strong importance inside the paragraph.
4
Add <code> tag around the word 'code'
Finally, wrap the word code in the paragraph with the <code> tag to show it as a code snippet.
HTML
Hint
Use the <code> tag exactly around the word code inside the paragraph.
Practice
(1/5)
1. Which of the following is an inline element in HTML?
easy
A. <article>
B. <div>
C. <section>
D. <span>
Solution
Step 1: Understand inline vs block elements
Inline elements do not start on a new line and only take up as much width as necessary.
Step 2: Identify the inline element among options
<span> is an inline element, while <div>, <section>, and <article> are block elements.
Final Answer:
<span> -> Option D
Quick Check:
Inline element = <span> [OK]
Hint: Inline tags don't break lines, block tags do [OK]
Common Mistakes:
Confusing <span> with <div>
Thinking <section> is inline
Assuming all tags are inline
2. Which of the following is the correct syntax to make text italic using a semantic inline element?
easy
A. <i>Text</i>
B. <italic>Text</italic>
C. <em>Text</em>
D. <strong>Text</strong>
Solution
Step 1: Identify inline tags for italic style
The <em> tag is used to emphasize text, typically rendering it in italics.
Step 2: Check other options
<i> also italicizes but <em> is preferred for meaning; <strong> is for strong importance; <italic> is not a valid tag.
Final Answer:
<em>Text</em> -> Option C
Quick Check:
Italic inline tag = <em> [OK]
Hint: Use <em> for emphasis italics, not <italic> [OK]
Common Mistakes:
Using non-existent <italic> tag
Confusing <strong> with italic
Choosing <i> over <em> without meaning
3. What will be the visual result of this HTML snippet?
<p>Hello <strong>World</strong>!</p>
medium
A. Hello World! (with 'World' bolded)
B. Hello World! (all normal text)
C. Hello World! (tags visible)
D. Hello World! (with 'World' italicized)
Solution
Step 1: Understand the tag effect
The <strong> tag makes text bold and emphasizes it.
Step 2: Visualize the output
The word 'World' inside <strong> will appear bold, while the rest remains normal.
Final Answer:
Hello World! (with 'World' bolded) -> Option A
Quick Check:
<strong> = bold text [OK]
Hint: Strong tag makes text bold without breaking line [OK]