Complete the code to create a simple alert box with Tailwind CSS.
<div class="bg-[1]-100 border border-[1]-400 text-[1]-700 px-4 py-3 rounded relative" role="alert"> <strong class="font-bold">Alert!</strong> <span class="block sm:inline">This is an alert message.</span> </div>
The alert box uses the red color scheme for background, border, and text to indicate an error or important alert.
Complete the code to add a close button to the alert with proper accessibility.
<button type="button" class="absolute top-0 bottom-0 right-0 px-4 py-3" aria-label="[1]"> <svg class="fill-current h-6 w-6 text-gray-500" role="button" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> <title>Close</title> <path d="M14.348 5.652a1 1 0 00-1.414-1.414L10 7.172 7.066 4.238a1 1 0 10-1.414 1.414L8.586 10l-2.934 2.934a1 1 0 101.414 1.414L10 12.828l2.934 2.934a1 1 0 001.414-1.414L11.414 10l2.934-2.934z"/> </svg> </button>
The aria-label should clearly describe the button's action for screen readers. "Close alert" is clear and descriptive.
Fix the error in the Tailwind alert code to make the alert background color correct.
<div class="bg-[1]-500 border border-[1]-700 text-white px-4 py-3 rounded relative" role="alert"> <strong class="font-bold">Success!</strong> <span class="block sm:inline">Your operation completed successfully.</span> </div>
Green is the correct color for success alerts. Using green-500 for background and green-700 for border fits the success message.
Fill both blanks to create a warning alert with an icon and proper color.
<div class="flex items-center bg-[1]-100 border-l-4 border-[2]-500 text-[2]-700 p-4" role="alert"> <svg class="fill-current w-6 h-6 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> <path d="M10 15a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm.25-9.75v4.5h-1.5v-4.5h1.5z"/> </svg> <p class="font-bold">Warning!</p> </div>
Yellow is the standard color for warning alerts. Both background and border use yellow shades for consistency.
Fill all three blanks to create a responsive notification banner with Tailwind CSS.
<div class="fixed top-0 inset-x-0 bg-[1]-600 text-white p-4 flex justify-between items-center"> <p class="text-sm font-medium">[2]</p> <button class="ml-4 text-white hover:text-[3]-200 focus:outline-none focus:ring-2 focus:ring-white rounded" aria-label="Close notification"> × </button> </div>
The banner uses a blue background with white text. The message is "New update available!" and the close button changes to a lighter blue on hover for clarity.