B. The syntax is invalid because of multiple max-width classes
C. The max-width decreases on larger screens, which is unusual
D. The classes will not apply because of missing lg: prefix
Solution
Step 1: Analyze the max-width values at breakpoints
At small screens, max-width is large (sm:max-w-lg), but at medium screens it drops to small (md:max-w-sm).
Step 2: Understand typical responsive behavior
Usually, max-width increases or stays the same on larger screens, not decreases.
Final Answer:
The max-width decreases on larger screens, which is unusual -> Option C
Quick Check:
Responsive max-width should not shrink on bigger screens [OK]
Hint: Max-width usually grows or stays same on bigger screens [OK]
Common Mistakes:
Thinking multiple max-width classes cause syntax errors
Believing sm: is invalid for max-width
Expecting missing lg: to cause errors
5. You want a container that is max-width small on mobile, medium on tablets, and extra-large on desktops. Which Tailwind class combination achieves this?
hard
A. max-w-sm sm:max-w-md md:max-w-lg
B. max-w-md sm:max-w-lg lg:max-w-xl
C. sm:max-w-sm md:max-w-md xl:max-w-xl
D. max-w-sm md:max-w-md lg:max-w-xl
Solution
Step 1: Assign max-width for mobile (default)
Use max-w-sm for small max-width on mobile (no prefix).
Step 2: Assign max-width for tablets (medium screens)
Use md:max-w-md to set medium max-width starting at medium breakpoint.
Step 3: Assign max-width for desktops (large screens)
Use lg:max-w-xl to set extra-large max-width starting at large breakpoint.
Final Answer:
max-w-sm md:max-w-md lg:max-w-xl -> Option D
Quick Check:
Default small + medium at md + extra-large at lg = max-w-sm md:max-w-md lg:max-w-xl [OK]
Hint: Set default, then md: and lg: for tablet and desktop widths [OK]
Common Mistakes:
Using sm: for mobile default instead of no prefix
Skipping the large breakpoint for desktop
Mixing up breakpoint order
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.