Challenge - 5 Problems
Bootstrap Alert Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What color will this alert have?
Given the following Bootstrap alert code, what color will the alert box appear as in the browser?
Bootsrap
<div class="alert alert-warning" role="alert">Watch out! This is a warning alert.</div>
Attempts:
2 left
💡 Hint
Look at the class name 'alert-warning' and think about what color warnings usually have.
✗ Incorrect
The class alert-warning in Bootstrap gives the alert a yellow background with dark text to indicate a warning.
🧠 Conceptual
intermediate1:30remaining
Which alert variant indicates success?
In Bootstrap, which alert variant class should you use to show a success message?
Attempts:
2 left
💡 Hint
Success messages usually use green colors.
✗ Incorrect
The alert-success class is used for success messages and shows a green alert box.
📝 Syntax
advanced2:00remaining
What error occurs with this alert code?
What error will this HTML code cause when used in a Bootstrap page?
Bootsrap
<div class="alert alert-info" role="alert"><p>Information alert</p></div>
Attempts:
2 left
💡 Hint
Check the opening div tag carefully for missing characters.
✗ Incorrect
The opening div tag is missing a closing '>' before the <p> tag, causing a syntax error in HTML.
❓ selector
advanced1:30remaining
Which CSS selector targets all Bootstrap danger alerts?
Which CSS selector will correctly select all Bootstrap alerts with the danger variant?
Attempts:
2 left
💡 Hint
Bootstrap uses classes starting with 'alert-' for alert variants.
✗ Incorrect
The class selector .alert-danger selects all elements with the class alert-danger, which is the Bootstrap danger alert variant.
❓ accessibility
expert2:00remaining
Why is the role="alert" attribute important in Bootstrap alerts?
What is the main accessibility benefit of adding
role="alert" to Bootstrap alert elements?Attempts:
2 left
💡 Hint
Think about how screen readers announce urgent messages.
✗ Incorrect
The role="alert" attribute tells screen readers to announce the alert content immediately, helping users with visual impairments notice important messages.