Complete the code to set the width of the div to 16rem using Tailwind CSS.
<div class="w-[1] bg-blue-500 text-white p-4">Hello</div>
The class w-64 sets the width to 16rem in Tailwind CSS because 1 unit equals 0.25rem, so 64 * 0.25rem = 16rem.
Complete the code to make the div take full width of its container using Tailwind CSS.
<div class="[1] bg-green-500 text-white p-4">Full width</div>
w-auto which sizes to content width.w-min or w-max which set min or max content widths.The class w-full makes the element take 100% width of its parent container.
Fix the error in the code to set the width to 50% using Tailwind CSS.
<div class="w-[1] bg-red-500 text-white p-4">Half width</div>
Tailwind uses fraction notation like w-1/2 to set widths as percentages. The correct class is w-1/2.
Fill both blanks to create a div with a fixed width of 8rem and a max width of 100% using Tailwind CSS.
<div class="[1] [2] bg-yellow-400 p-4">Fixed and max width</div>
w-full with max width classes.max-w-32 instead of max-w-full.w-32 sets width to 8rem (32 * 0.25rem). max-w-full limits max width to 100% of container.
Fill all three blanks to create a responsive div that is full width on small screens, 50% width on medium screens, and 25% width on large screens using Tailwind CSS.
<div class="[1] md:[2] lg:[3] bg-purple-600 text-white p-4">Responsive width</div>
md: and lg:.w-auto which sizes to content, not percentages.w-full sets full width on small screens. md:w-1/2 sets 50% width on medium screens. lg:w-1/4 sets 25% width on large screens.