Spacing
Understand padding, margin, gap and spacing utilities.
Learning approach
Study the Tailwind classes in the example, run the preview, then modify the classes and observe how the design changes.
Tailwind Example
HTML + Tailwind CSS
<div class="p-8 bg-slate-100">
<div class="mb-4 bg-white p-4 rounded-xl">
Margin Bottom
</div>
<div class="mt-4 bg-white p-4 rounded-xl">
Margin Top
</div>
</div>
Live Preview
Your Tailwind design will appear here.
Click Run Preview
See the lesson example here.
Test your understanding
Choose the best answer.
Which Tailwind utility creates a flex container?