0
0
Bootsrapmarkup~20 mins

Alert variants and colors in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Alert Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
ABlue background with white text
BYellow background with dark text
CRed background with white text
DGreen background with dark text
Attempts:
2 left
💡 Hint
Look at the class name 'alert-warning' and think about what color warnings usually have.
🧠 Conceptual
intermediate
1:30remaining
Which alert variant indicates success?
In Bootstrap, which alert variant class should you use to show a success message?
Aalert-success
Balert-danger
Calert-primary
Dalert-info
Attempts:
2 left
💡 Hint
Success messages usually use green colors.
📝 Syntax
advanced
2: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>
ARole attribute is invalid and causes error
BNo error, alert renders correctly
CSyntax error due to missing closing bracket in div tag
DBootstrap styles won't apply because of wrong class name
Attempts:
2 left
💡 Hint
Check the opening div tag carefully for missing characters.
selector
advanced
1:30remaining
Which CSS selector targets all Bootstrap danger alerts?
Which CSS selector will correctly select all Bootstrap alerts with the danger variant?
A.alert-danger
B#alert-danger
Calert-danger
D.danger-alert
Attempts:
2 left
💡 Hint
Bootstrap uses classes starting with 'alert-' for alert variants.
accessibility
expert
2: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?
AIt hides the alert from all users
BIt changes the alert color to red automatically
CIt disables keyboard navigation inside the alert
DIt makes the alert content read immediately by screen readers
Attempts:
2 left
💡 Hint
Think about how screen readers announce urgent messages.