0
0
Bootsrapmarkup~5 mins

Dismissible alerts in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a dismissible alert in Bootstrap?
A dismissible alert is a message box that users can close or hide by clicking a close button. It helps show important info that can be removed when no longer needed.
Click to reveal answer
beginner
Which Bootstrap class makes an alert dismissible?
The class alert-dismissible is added to the alert container to make it dismissible.
Click to reveal answer
beginner
What HTML element is used for the close button in a dismissible alert?
A <code>&lt;button&gt;</code> element with <code>btn-close</code> class and <code>data-bs-dismiss="alert"</code> attribute is used for the close button.
Click to reveal answer
intermediate
Why is it important to include aria-label="Close" on the dismiss button?
It improves accessibility by letting screen readers know the button's purpose is to close the alert.
Click to reveal answer
intermediate
How does Bootstrap handle the alert dismissal behavior?
Bootstrap uses JavaScript to listen for clicks on the close button and then removes the alert from the page smoothly.
Click to reveal answer
Which class do you add to a Bootstrap alert to make it dismissible?
Aalert-dismiss
Balert-close
Calert-hide
Dalert-dismissible
What attribute must the close button have to dismiss the alert?
Adata-dismiss="alert"
Bdata-bs-toggle="alert"
Cdata-bs-dismiss="alert"
Ddata-toggle="close"
Which element is typically used for the close button in a dismissible alert?
A&lt;button&gt;
B&lt;span&gt;
C&lt;a&gt;
D&lt;div&gt;
Why should you add aria-label="Close" to the close button?
ATo help screen readers understand the button's purpose
BTo style the button
CTo improve keyboard navigation
DTo make the button bigger
What happens when you click the close button on a dismissible alert?
AThe alert changes color
BThe alert disappears smoothly
CThe alert reloads the page
DNothing happens
Explain how to create a dismissible alert in Bootstrap and why it is useful.
Think about the classes and attributes needed and the user experience.
You got /4 concepts.
    Describe the accessibility features important for dismissible alerts in Bootstrap.
    Focus on how screen readers and keyboard users interact with the alert.
    You got /4 concepts.