- Width:
w-32,w-1/2,w-full,w-screen - Height:
h-16,h-screen,min-h-screen - Max width:
max-w-md,max-w-3xl - Both at once:
size-12
Tailwind Sizing
Width, height and max-width.
✍️ 3 exercises + code challenge in this lessonKey Takeaways: Tailwind Sizing
Mastering Tailwind Sizing helps you write clean and reliable Tailwind CSS code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
Tailwind Sizing Code Example
Tailwind CSS<script src="https://cdn.tailwindcss.com"></script>
<div class="p-6 space-y-2">
<div class="w-32 h-8 bg-cyan-400">w-32</div>
<div class="w-1/2 h-8 bg-cyan-500">w-1/2</div>
<div class="w-full h-8 bg-cyan-600 text-white">w-full</div>
<div class="size-12 bg-slate-800 rounded-full"></div>
</div>
Free sign-in required · Google login available
Tailwind Sizing Practice Exercises
Check what you learned in “Tailwind Sizing”.
/ 3 solved
Fill in the blank
Make the element full width.
<div class="">...</div>
✓ Correct!
Not quite. Try again.
Multiple choice
What does w-1/2 mean?
✓ Correct!
Not quite. Try again.
Code challenge
Make the box w-32 and h-32.
Write the code in the live editor. Your answer is checked automatically.
✓ Solved
Free sign-in required · Google login available
to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.
Stuck on something?
Ask the community in the CodesInTech forum.
Need a developer?
Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.
Explore Our Services