0
0
Tailwindmarkup~20 mins

Mobile-first philosophy in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Mobile-First Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
2:00remaining
Understanding Tailwind's Mobile-First Breakpoints
Which Tailwind CSS class applies styles only on screens wider than 768px (medium devices and up)?
Alg:text-center
Bmd:text-center
Ctext-center md:text-center
Dtext-center md:
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like md: to apply styles from that breakpoint and up.
layout
intermediate
2: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>
A100% width
B25% width
C50% width
D0 width (hidden)
Attempts:
2 left
💡 Hint
Tailwind applies styles without prefixes first, then overrides at breakpoints.
rendering
advanced
2: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>
ABoxes hidden
BBoxes side by side horizontally, blue box left, green box right
CBoxes overlap each other
DBoxes stacked vertically, blue box on top, green box below
Attempts:
2 left
💡 Hint
The flex-col class stacks items vertically, and sm:flex-row changes layout on larger screens.
accessibility
advanced
2:00remaining
Accessibility Considerations in Mobile-First Design
Which practice best improves accessibility for a mobile-first navigation menu using Tailwind CSS?
AUse semantic <nav> element with aria-label and ensure keyboard focus styles are visible
BHide navigation on mobile using display:none without alternative access
CUse only color changes to indicate active menu items without focus styles
DUse <div> elements for navigation without roles or labels
Attempts:
2 left
💡 Hint
Accessibility means everyone can use your site, including keyboard users and screen readers.
🧠 Conceptual
expert
2:00remaining
Why Mobile-First CSS is Preferred in Tailwind
Why does Tailwind CSS use a mobile-first approach for its responsive utilities?
ABecause mobile-first CSS disables styles on desktop by default
BBecause desktop styles override mobile styles by default, making desktop easier to style
CBecause mobile-first CSS loads smaller styles first, improving performance on mobile devices
DBecause mobile-first CSS requires writing more code, which is better for maintainability
Attempts:
2 left
💡 Hint
Think about what devices usually have slower connections and smaller screens.