0
0
HTMLmarkup~20 mins

Inline elements in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Inline Elements Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the inline element
Which of the following HTML tags is an inline element by default?
A<div>
B<span>
C<section>
D<article>
Attempts:
2 left
💡 Hint
Think about elements that do not start on a new line and are used inside text.
📝 Syntax
intermediate
1:30remaining
Correct inline element usage
Which option correctly uses inline elements to emphasize text within a paragraph?
HTML
<p>This is a <em>very</em> important message.</p>
A<p>This is a <em>very</em> important message.</p>
B<p>This is a <div>very</div> important message.</p>
C<p>This is a <section>very</section> important message.</p>
D<p>This is a <article>very</article> important message.</p>
Attempts:
2 left
💡 Hint
Inline elements can be placed inside paragraphs without breaking the line.
rendering
advanced
2:00remaining
Visual difference between inline and block elements
What will you see in the browser when rendering this HTML?

<div>Block 1</div><span>Inline 1</span><div>Block 2</div><span>Inline 2</span>
HTML
<div>Block 1</div><span>Inline 1</span><div>Block 2</div><span>Inline 2</span>
ABlock 1 on its own line, Inline 1 next to it, Block 2 on a new line, Inline 2 next to Block 2
BAll four elements appear on the same line
CBlock 1 and Block 2 appear on the same line, Inline 1 and Inline 2 each on new lines
DBlock 1 and Inline 1 on one line, Block 2 and Inline 2 on the next line
Attempts:
2 left
💡 Hint
Block elements start on new lines, inline elements flow within lines.
selector
advanced
2:00remaining
CSS selector for inline elements
Which CSS selector will select all inline elements inside a container with id 'content'?
A#content div, #content section, #content article
B#content > *:not(div):not(section):not(article)
C#content span, #content em, #content a
D#content block
Attempts:
2 left
💡 Hint
Inline elements include tags like span, em, and a.
accessibility
expert
2:30remaining
Accessibility of inline elements
Which practice improves accessibility when using inline elements for emphasis?
AUse &lt;span&gt; with CSS color change only, no semantic tags
BUse &lt;div&gt; with aria-label for emphasis
CUse inline styles with font-weight:bold on &lt;span&gt; without semantic tags
DUse &lt;em&gt; or &lt;strong&gt; tags to convey emphasis semantically
Attempts:
2 left
💡 Hint
Screen readers rely on semantic tags to understand emphasis.