Complete the code to make the word italic using an inline element.
<p>This is an [1] element example.</p>The em tag is an inline element used to emphasize text, usually rendering it in italics.
Complete the code to make the word bold using an inline element.
<p>This word is [1].</p>The tag is an inline element used to make text bold and indicate strong importance.
Fix the error in the code to correctly underline the text using an inline element.
<p>This is an [1] text example.</p>The tag is the correct inline element to underline text in HTML.
Fill both blanks to create a sentence where the first word is italic and the second word is bold.
<p><[1]>Hello</[1]> <[2]>World</[2]></p>
The tag italicizes text and the tag makes text bold. Both are inline elements.
Fill all three blanks to create a sentence with an inline link, italic text, and bold text.
<p><a href="#">[1]</a> is <[2]>important</[2]> and <[3]>strong</[3]> text.</p>
Practice
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 DQuick Check:
Inline element = <span> [OK]
- Confusing <span> with <div>
- Thinking <section> is inline
- Assuming all tags are inline
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 CQuick Check:
Italic inline tag = <em> [OK]
- Using non-existent <italic> tag
- Confusing <strong> with italic
- Choosing <i> over <em> without meaning
<p>Hello <strong>World</strong>!</p>
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 AQuick Check:
<strong> = bold text [OK]
- Thinking <strong> italicizes text
- Expecting tags to show as text
- Assuming whole sentence is bold
<p>Click <a href='https://example.com'>here</p></a>
Solution
Step 1: Check tag nesting rules
Inline elements like<a>must be properly opened and closed inside block elements like<p>.Step 2: Identify the error in closing tags
The<a>tag is opened inside<p>but closed after</p>, which breaks proper nesting.Final Answer:
The <a> tag is not closed properly inside <p> -> Option BQuick Check:
Inline tags must close before block ends [OK]
- Closing <a> after
- Thinking <p> can't contain inline tags
- Ignoring tag nesting order
Solution
Step 1: Understand the purpose of inline styling
To style small parts of text without breaking lines, an inline element that does not create new blocks is needed.Step 2: Identify the best inline element for styling
<span>is a generic inline container used to apply styles or classes to parts of text without affecting layout.Final Answer:
<span> -> Option AQuick Check:
Use <span> for inline styling [OK]
- Using block tags like <div> for inline styling
- Confusing <section> or <article> with inline tags
- Trying to style text without a container
Ready to prove it?
Pass the test and this pattern moves unknown
