Responsive design
Use mobile-first breakpoints and container-aware spacing.
What you will be able to do
- Start with the base (mobile) classes.
- Add md: and lg: for larger layouts.
- Use hidden md:block only for genuinely supplementary content.
- Test at 360px, 768px and 1280px.
In plain English
Tailwind is mobile-first: an unprefixed utility applies everywhere, and sm:, md:, lg: override from that width up. Design the small screen first, then add the larger layout instead of hiding desktop content.
<div class="flex flex-col gap-4 md:flex-row md:items-center">
<h1 class="text-2xl font-semibold md:text-3xl">Dashboard</h1>
<button class="rounded-md bg-cyan-600 px-4 py-2 text-white md:ml-auto">New course</button>
</div>Your turn
EasyStack on mobile, row on desktop
Make a container a column by default and a row from md up with a gap of 4.
HTML · starter
<div class="flex">Check your understanding before moving on.
Knowledge checkQuestion 1
Which utility applies only from the md breakpoint upward?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.