What is the minimum and maximum width of the div in rem?
medium
A. Minimum 12rem, Maximum 24rem
B. Minimum 24rem, Maximum 48rem
C. Minimum 6rem, Maximum 12rem
D. Minimum 48rem, Maximum 96rem
Solution
Step 1: Convert min-w-24 to rem
In Tailwind, 24 equals 6rem (24 * 0.25rem).
Step 2: Convert max-w-48 to rem
48 equals 12rem (48 * 0.25rem).
Final Answer:
Minimum 6rem, Maximum 12rem -> Option C
Quick Check:
min-w-24 = 6rem, max-w-48 = 12rem [OK]
Hint: Multiply spacing number by 0.25rem for size [OK]
Common Mistakes:
Assuming numbers are pixels
Mixing min and max values
Forgetting Tailwind spacing scale factor
4. You want to limit a box's height between 4rem and 8rem using Tailwind. Which class combination is incorrect?
medium
A. min-h-16 max-h-8
B. min-h-16 max-h-32
C. min-h-4 max-h-8
D. min-h-8 max-h-16
Solution
Step 1: Understand Tailwind spacing scale
16 equals 4rem and 32 equals 8rem (16*0.25=4rem, 32*0.25=8rem).
Step 2: Check each option's min and max values
min-h-16 max-h-8 sets min-h-16 (4rem) but max-h-8 (2rem), which is smaller than min height, causing conflict.
Final Answer:
min-h-16 max-h-8 -> Option A
Quick Check:
Max height smaller than min height is invalid [OK]
Hint: Max size must be equal or larger than min size [OK]
Common Mistakes:
Setting max smaller than min
Confusing spacing numbers with rem
Using wrong prefixes (w vs h)
5. You want a responsive card that never gets narrower than 12rem but no wider than 24rem. Which Tailwind classes achieve this and also ensure the card height is at least 8rem but no more than 16rem?