5. You want a responsive div that has a fixed height of 8rem on small screens, but on medium screens and above, it should have a maximum height of 12rem and scroll if content overflows. Which Tailwind classes achieve this?
hard
A. h-8 md:max-h-12 md:overflow-scroll
B. h-32 md:max-h-48 md:overflow-auto
C. h-32 md:max-h-48 md:overflow-scroll
D. h-8 md:max-h-48 md:overflow-auto
Solution
Step 1: Convert rem to Tailwind scale
8rem = 32 x 0.25rem, so h-32 sets height 8rem. 12rem = 48 x 0.25rem, so max-h-48 sets max height 12rem.
Step 2: Apply responsive prefixes and overflow
On small screens, fixed height 8rem means h-32. On medium screens and above, max height 12rem with scroll means md:max-h-48 md:overflow-auto.
Step 3: Match options with correct classes
h-32 md:max-h-48 md:overflow-auto uses correct classes for fixed height and responsive max height with scroll. Other options have incorrect scales or overflow behavior.