Recall & Review
beginner
What is the main purpose of an alert or notification in web design?
Alerts and notifications inform users about important information, errors, or updates that need their attention.
Click to reveal answer
beginner
Which Tailwind CSS utility class would you use to give an alert a red background for an error message?Use
bg-red-500 or a similar red shade like bg-red-600 to indicate an error alert background.Click to reveal answer
intermediate
Why should alerts be accessible and what ARIA role is commonly used?
Alerts should be accessible so screen readers can announce them immediately. The ARIA role
alert is used for this purpose.Click to reveal answer
intermediate
How can you make a notification dismissible using Tailwind CSS and basic HTML?
Add a close button inside the alert with a clear label (like
aria-label="Close alert") and use JavaScript to remove the alert from the DOM when clicked.Click to reveal answer
beginner
What Tailwind CSS classes help make alerts responsive and visually clear on different screen sizes?
Use padding classes like
p-4, margin classes like mb-4, and text classes like text-sm md:text-base to ensure alerts look good on all devices.Click to reveal answer
Which ARIA role should you add to an alert to make it accessible?
✗ Incorrect
The
role="alert" tells screen readers to announce the alert immediately.Which Tailwind class is best for a success alert background?
✗ Incorrect
Green shades like
bg-green-500 are commonly used for success messages.What is a good practice for making alerts dismissible?
✗ Incorrect
A close button with an accessible label and JavaScript to remove the alert is best.
Which Tailwind utility helps add spacing inside an alert box?
✗ Incorrect
p-4 adds padding inside the alert for spacing.Why should alerts use semantic HTML elements like
section or div with roles?✗ Incorrect
Semantic elements and ARIA roles help assistive technologies understand the alert.
Explain how to create an accessible, dismissible alert using Tailwind CSS.
Think about accessibility, styling, and user interaction.
You got /4 concepts.
Describe the color choices and spacing utilities in Tailwind CSS for different alert types.
Consider how colors communicate meaning and spacing improves readability.
You got /4 concepts.