Complete the code to add a fixed overlay background behind the modal.
<div class="fixed inset-0 bg-black bg-opacity-[1]"></div>
The bg-opacity-25 class sets the overlay transparency to 25%, making the background dim but still visible.
Complete the code to center the modal box horizontally and vertically using Flexbox.
<div class="fixed inset-0 [1] items-center justify-center"> <!-- Modal content --> </div>
flex means alignment classes have no effect.items-center or justify-center without flex.The flex class activates Flexbox layout, which is needed for items-center and justify-center to work and center the modal.
Fix the error in the modal close button to make it accessible by keyboard.
<button type="button" class="absolute top-4 right-4 p-2 focus:[1]" aria-label="Close modal"> × </button>
focus:outline-none removes focus indication, hurting accessibility.focus:outline-hidden is not a valid Tailwind class.The focus:ring class adds a visible ring around the button when focused, helping keyboard users see the focus.
Fill both blanks to create a modal container with white background and rounded corners.
<div class="bg-[1] [2] p-6 max-w-md w-full"> <!-- Modal content --> </div>
bg-gray-100 makes the background off-white.rounded-full makes the modal fully rounded like a pill shape.bg-white sets a clean white background, and rounded-lg gives the modal softly rounded corners for a friendly look.
Fill all three blanks to create a modal with shadow, padding, and max width.
<div class="shadow-[1] p-[2] max-w-[3] w-full"> <!-- Modal content --> </div>
shadow-sm or no shadow makes the modal flat.max-w-xl makes the modal too wide on small screens.shadow-lg adds a large shadow for depth, p-6 adds comfortable padding, and max-w-md limits the modal width for readability.