Challenge - 5 Problems
Alt Text Accessibility Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is alt text important for images?
Which of the following best explains why adding
alt text to images is important in web development?Attempts:
2 left
💡 Hint
Think about users who cannot see images and how they might understand the content.
✗ Incorrect
Alt text provides a description of images for screen readers used by visually impaired users and helps search engines index images properly.
📝 Syntax
intermediate2:00remaining
Identify the correct alt attribute syntax
Which option shows the correct way to add alt text to an image in HTML?
HTML
<img src="flower.jpg" ____ >
Attempts:
2 left
💡 Hint
Alt text must be inside quotes and properly formatted.
✗ Incorrect
The alt attribute value must be enclosed in quotes (single or double). Option D uses double quotes correctly.
❓ rendering
advanced2:00remaining
What is the visible output when alt text is used?
If an image fails to load in a browser, what will the user see if the image tag has alt text?
HTML
<img src="missing.jpg" alt="A mountain landscape">
Attempts:
2 left
💡 Hint
Alt text is a fallback description when images cannot load.
✗ Incorrect
When an image cannot load, browsers display the alt text so users understand what was meant to be shown.
❓ selector
advanced2:00remaining
Which CSS selector targets images missing alt text?
You want to style images that do NOT have an alt attribute or have an empty alt attribute. Which CSS selector will select those images?
Attempts:
2 left
💡 Hint
Think about selecting elements missing an attribute or with an empty attribute value.
✗ Incorrect
The selector img:not([alt]) selects images without alt attribute, and img[alt=""] selects images with empty alt text.
❓ accessibility
expert3:00remaining
Best practice for decorative images with alt text
For purely decorative images that add no meaningful content, what is the best practice for the alt attribute to ensure accessibility?
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 that do not add information.