Height utilities
📖 Scenario: You are building a simple webpage section that shows three colored boxes stacked vertically. Each box should have a different height using Tailwind CSS height utilities.
🎯 Goal: Create three <div> elements inside a container. Use Tailwind CSS height utilities to set the first box height to h-16, the second box height to h-24, and the third box height to h-32. Each box should have a distinct background color and some margin between them.
📋 What You'll Learn
Use a container
<section> with Tailwind class p-4 for padding.Create three
<div> boxes inside the container.Set the first box height to
h-16 and background color to bg-red-500.Set the second box height to
h-24 and background color to bg-green-500.Set the third box height to
h-32 and background color to bg-blue-500.Add vertical margin
mb-4 between the boxes.💡 Why This Matters
🌍 Real World
Setting fixed heights on elements is common in web design to create consistent layouts, cards, or sections with visual balance.
💼 Career
Knowing how to use Tailwind CSS height utilities helps you quickly style components in modern web projects, improving your frontend development skills.
Progress0 / 4 steps