Challenge - 5 Problems
Mobile-First Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ selector
intermediate2:00remaining
Understanding Tailwind's Mobile-First Breakpoints
Which Tailwind CSS class applies styles only on screens wider than 768px (medium devices and up)?
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like
md: to apply styles from that breakpoint and up.✗ Incorrect
The
md: prefix applies styles starting at the medium breakpoint (768px). Option B correctly uses md:text-center to center text only on medium screens and larger. Option B is invalid syntax. Option B applies text-center always and again at md, so not only at md. Option B applies styles at large screens (1024px) and up.❓ layout
intermediate2:00remaining
Mobile-First Responsive Layout with Tailwind
Given this Tailwind HTML snippet, what will be the width of the
div on a small screen (less than 640px)?
<div class="w-full sm:w-1/2 lg:w-1/4">Content</div>
Tailwind
<div class="w-full sm:w-1/2 lg:w-1/4">Content</div>Attempts:
2 left
💡 Hint
Tailwind applies styles without prefixes first, then overrides at breakpoints.
✗ Incorrect
The class
w-full applies 100% width by default (mobile first). The sm:w-1/2 applies 50% width starting at 640px, and lg:w-1/4 applies 25% width starting at 1024px. On screens smaller than 640px, only w-full applies.❓ rendering
advanced2:00remaining
Visual Result of Mobile-First Flexbox Layout
What will you see on a mobile screen (less than 640px wide) for this Tailwind HTML?
<div class="flex flex-col sm:flex-row"> <div class="p-4 bg-blue-500">Box 1</div> <div class="p-4 bg-green-500">Box 2</div> </div>
Tailwind
<div class="flex flex-col sm:flex-row"> <div class="p-4 bg-blue-500">Box 1</div> <div class="p-4 bg-green-500">Box 2</div> </div>
Attempts:
2 left
💡 Hint
The
flex-col class stacks items vertically, and sm:flex-row changes layout on larger screens.✗ Incorrect
On mobile screens,
flex-col applies, stacking boxes vertically. The sm:flex-row applies only on screens 640px and wider, changing layout to horizontal. So on mobile, boxes appear stacked with Box 1 on top.❓ accessibility
advanced2:00remaining
Accessibility Considerations in Mobile-First Design
Which practice best improves accessibility for a mobile-first navigation menu using Tailwind CSS?
Attempts:
2 left
💡 Hint
Accessibility means everyone can use your site, including keyboard users and screen readers.
✗ Incorrect
Using semantic
🧠 Conceptual
expert2:00remaining
Why Mobile-First CSS is Preferred in Tailwind
Why does Tailwind CSS use a mobile-first approach for its responsive utilities?
Attempts:
2 left
💡 Hint
Think about what devices usually have slower connections and smaller screens.
✗ Incorrect
Mobile-first CSS applies base styles for small screens first, then adds overrides for larger screens. This means mobile devices load only essential styles initially, improving performance. Desktop styles override mobile styles as needed. Options B, C, and D are incorrect or misleading.