Challenge - 5 Problems
Image Alt Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding the purpose of the alt attribute
Why is the
alt attribute important for an <img> tag in HTML?Attempts:
2 left
💡 Hint
Think about accessibility and what happens if the image cannot be displayed.
✗ Incorrect
The
alt attribute describes the image for people using screen readers and shows text if the image doesn't load.📝 Syntax
intermediate2:00remaining
Correct syntax for image source and alt
Which of the following
<img> tags is correctly written with both src and alt attributes?Attempts:
2 left
💡 Hint
Check attribute names and if values are properly quoted.
✗ Incorrect
Option A uses correct attribute names and quotes values properly. Others have wrong attribute names or missing values.
❓ rendering
advanced2:00remaining
What is displayed if image source is broken?
Given this HTML code:
What will the browser show if
<img src="missing.jpg" alt="Logo image">
What will the browser show if
missing.jpg does not exist?Attempts:
2 left
💡 Hint
Think about fallback content for images that fail to load.
✗ Incorrect
Browsers display the alt text if the image cannot load, helping users understand what was meant to be shown.
❓ selector
advanced2:00remaining
Selecting images with missing alt attributes using CSS
Which CSS selector targets all
<img> elements that do NOT have an alt attribute?Attempts:
2 left
💡 Hint
Look for a selector that matches elements missing a specific attribute.
✗ Incorrect
The selector
img:not([alt]) matches images without the alt attribute. Option D matches images with empty alt, C matches images with alt, D matches empty elements.❓ accessibility
expert2:00remaining
Best practice for decorative images and alt attribute
For purely decorative images that add no information, what is the best way to use the
alt attribute to keep the page accessible?Attempts:
2 left
💡 Hint
Think about how screen readers treat empty alt attributes.
✗ Incorrect
An empty alt attribute tells screen readers to ignore the image, which is best for decorative images. Omitting alt causes screen readers to read the file name, which is confusing.