0
0
HTMLmarkup~20 mins

Common HTML mistakes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
HTML Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What error does this HTML snippet cause?
Look at this HTML code:
<div>Hello<span>World</div></span>

What problem will this cause when rendered in a browser?
HTML
<div>Hello<span>World</span></div>
AThe browser will close the &lt;span&gt; before the &lt;/div&gt;, causing incorrect nesting.
BThe browser will render correctly with no visible issues.
CThe browser will throw a syntax error and stop rendering the page.
DThe browser will ignore the &lt;span&gt; tag completely.
Attempts:
2 left
💡 Hint
Think about how tags must open and close in the right order.
accessibility
intermediate
2:00remaining
Which option improves accessibility for this image?
You have this image tag:
<img src="flower.jpg">

Which option adds the best accessibility improvement?
HTML
<img src="flower.jpg">
A<img src="flower.jpg" role="presentation">
B<img src="flower.jpg" title="flower">
C<img src="flower.jpg" aria-hidden="true">
D<img src="flower.jpg" alt="A red flower in a garden">
Attempts:
2 left
💡 Hint
Think about screen readers and what they need to describe images.
layout
advanced
2:00remaining
What visual issue occurs with this CSS and HTML?
Given this HTML and CSS:
<div class="container"><div class="box">Box</div></div>

.container { display: flex; } .box { width: 100px; margin-left: auto; }

What will happen to the box inside the container?
HTML
<div class="container"><div class="box">Box</div></div>
AThe box will be aligned to the left side ignoring margin-left.
BThe box will be centered horizontally inside the container.
CThe box will be aligned to the right side of the container.
DThe box will overflow outside the container.
Attempts:
2 left
💡 Hint
Remember how margin auto works inside flex containers.
selector
advanced
2:00remaining
Which CSS selector matches only direct children?
You want to style only <li> elements that are direct children of <ul>.
Which selector should you use?
Aul li
Bul > li
Cul + li
Dul ~ li
Attempts:
2 left
💡 Hint
Think about the difference between descendant and child selectors.
🧠 Conceptual
expert
2:00remaining
What is the effect of missing viewport meta tag on mobile?
Consider a webpage without this tag:
<meta name="viewport" content="width=device-width, initial-scale=1">

What will happen when viewed on a mobile device?
AThe page will zoom out and show a desktop-sized layout, making text small and hard to read.
BThe page will automatically switch to a mobile-friendly layout.
CThe page will not load at all on mobile devices.
DThe page will scale to fit the device width and look good on mobile.
Attempts:
2 left
💡 Hint
Think about how browsers handle page scaling without instructions.