Challenge - 5 Problems
Attribute Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding HTML Attributes
Which of the following best describes what an attribute in an HTML tag does?
Attempts:
2 left
💡 Hint
Think about how you add details to an HTML tag to change its behavior or appearance.
✗ Incorrect
Attributes add extra details to HTML elements, such as id, class, or href. They do not create or remove elements or change browser defaults directly.
📝 Syntax
intermediate1:30remaining
Correct Attribute Syntax
Which option shows the correct way to add a class attribute to a <div> element?
HTML
<div ???>Content</div>
Attempts:
2 left
💡 Hint
Attributes need an equals sign and quotes around the value.
✗ Incorrect
The correct syntax for attributes is attribute="value" or attribute='value'. Missing quotes or wrong separators cause errors.
❓ rendering
advanced2:00remaining
Effect of the alt Attribute on Images
What will the browser display if an image has a broken link but includes an alt attribute like
alt="Logo"?HTML
<img src="broken-link.jpg" alt="Logo">
Attempts:
2 left
💡 Hint
Alt text helps when images cannot load.
✗ Incorrect
The alt attribute provides alternative text that browsers show if the image cannot load. This helps users understand what was meant to be there.
❓ selector
advanced2:00remaining
Selecting Elements by Attribute in CSS
Which CSS selector will style all <a> elements that have a title attribute?
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets.
✗ Incorrect
The selector a[title] targets all <a> tags with a title attribute, regardless of its value.
❓ accessibility
expert2:30remaining
Role of ARIA Attributes
What is the main purpose of ARIA attributes like
aria-label in HTML?Attempts:
2 left
💡 Hint
ARIA helps people who use assistive technology.
✗ Incorrect
ARIA attributes give screen readers and other assistive tools extra details about elements, improving accessibility for users with disabilities.