5.1 Padding
Padding is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
Step by step
- Identify the CSS behavior behind Padding.
- Build a very small HTML example before placing it inside a large component.
- Apply the Tailwind utilities and inspect the result at multiple viewport widths.
- Add interaction, dark mode, RTL, or accessibility states when the component needs them.
- Refactor repeated markup into a reusable component only after the visual rule is understood.
10 practical examples
- Apply Padding to a course website and explain the decision you made.
- Apply Padding to a online store and explain the decision you made.
- Apply Padding to a banking app and explain the decision you made.
- Apply Padding to a school portal and explain the decision you made.
- Apply Padding to a clinic booking system and explain the decision you made.
- Apply Padding to a dashboard and explain the decision you made.
- Apply Padding to a restaurant site and explain the decision you made.
- Apply Padding to a mobile app and explain the decision you made.
- Apply Padding to a creator site and explain the decision you made.
- Apply Padding to a business landing page and explain the decision you made.
Hands-on example
<div class="p-6 bg-slate-100">Padded content</div>Expected output
A working responsive example demonstrating Padding, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Padding using a different product, screen, component, or content set. Explain what changed and why.
5.2 Margin
Margin is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
Step by step
- Identify the CSS behavior behind Margin.
- Build a very small HTML example before placing it inside a large component.
- Apply the Tailwind utilities and inspect the result at multiple viewport widths.
- Add interaction, dark mode, RTL, or accessibility states when the component needs them.
- Refactor repeated markup into a reusable component only after the visual rule is understood.
10 practical examples
- Apply Margin to a course website and explain the decision you made.
- Apply Margin to a online store and explain the decision you made.
- Apply Margin to a banking app and explain the decision you made.
- Apply Margin to a school portal and explain the decision you made.
- Apply Margin to a clinic booking system and explain the decision you made.
- Apply Margin to a dashboard and explain the decision you made.
- Apply Margin to a restaurant site and explain the decision you made.
- Apply Margin to a mobile app and explain the decision you made.
- Apply Margin to a creator site and explain the decision you made.
- Apply Margin to a business landing page and explain the decision you made.
Hands-on example
<div class="mt-8 mb-4">Spacing with margin</div>Expected output
A working responsive example demonstrating Margin, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Margin using a different product, screen, component, or content set. Explain what changed and why.
5.3 Space Between
Space Between is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
Step by step
- Identify the CSS behavior behind Space Between.
- Build a very small HTML example before placing it inside a large component.
- Apply the Tailwind utilities and inspect the result at multiple viewport widths.
- Add interaction, dark mode, RTL, or accessibility states when the component needs them.
- Refactor repeated markup into a reusable component only after the visual rule is understood.
10 practical examples
- Apply Space Between to a course website and explain the decision you made.
- Apply Space Between to a online store and explain the decision you made.
- Apply Space Between to a banking app and explain the decision you made.
- Apply Space Between to a school portal and explain the decision you made.
- Apply Space Between to a clinic booking system and explain the decision you made.
- Apply Space Between to a dashboard and explain the decision you made.
- Apply Space Between to a restaurant site and explain the decision you made.
- Apply Space Between to a mobile app and explain the decision you made.
- Apply Space Between to a creator site and explain the decision you made.
- Apply Space Between to a business landing page and explain the decision you made.
Hands-on example
<div class="flex flex-wrap items-center gap-4 rounded-xl border bg-white p-6 shadow-sm">
<span class="font-semibold text-slate-900">Space Between</span>
</div>Expected output
A working responsive example demonstrating Space Between, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Space Between using a different product, screen, component, or content set. Explain what changed and why.
5.4 Negative Spacing
Negative Spacing is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
Step by step
- Identify the CSS behavior behind Negative Spacing.
- Build a very small HTML example before placing it inside a large component.
- Apply the Tailwind utilities and inspect the result at multiple viewport widths.
- Add interaction, dark mode, RTL, or accessibility states when the component needs them.
- Refactor repeated markup into a reusable component only after the visual rule is understood.
10 practical examples
- Apply Negative Spacing to a course website and explain the decision you made.
- Apply Negative Spacing to a online store and explain the decision you made.
- Apply Negative Spacing to a banking app and explain the decision you made.
- Apply Negative Spacing to a school portal and explain the decision you made.
- Apply Negative Spacing to a clinic booking system and explain the decision you made.
- Apply Negative Spacing to a dashboard and explain the decision you made.
- Apply Negative Spacing to a restaurant site and explain the decision you made.
- Apply Negative Spacing to a mobile app and explain the decision you made.
- Apply Negative Spacing to a creator site and explain the decision you made.
- Apply Negative Spacing to a business landing page and explain the decision you made.
Hands-on example
<div class="flex flex-wrap items-center gap-4 rounded-xl border bg-white p-6 shadow-sm">
<span class="font-semibold text-slate-900">Negative Spacing</span>
</div>Expected output
A working responsive example demonstrating Negative Spacing, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Negative Spacing using a different product, screen, component, or content set. Explain what changed and why.
5.5 Logical Spacing
Logical Spacing is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
Step by step
- Identify the CSS behavior behind Logical Spacing.
- Build a very small HTML example before placing it inside a large component.
- Apply the Tailwind utilities and inspect the result at multiple viewport widths.
- Add interaction, dark mode, RTL, or accessibility states when the component needs them.
- Refactor repeated markup into a reusable component only after the visual rule is understood.
10 practical examples
- Apply Logical Spacing to a course website and explain the decision you made.
- Apply Logical Spacing to a online store and explain the decision you made.
- Apply Logical Spacing to a banking app and explain the decision you made.
- Apply Logical Spacing to a school portal and explain the decision you made.
- Apply Logical Spacing to a clinic booking system and explain the decision you made.
- Apply Logical Spacing to a dashboard and explain the decision you made.
- Apply Logical Spacing to a restaurant site and explain the decision you made.
- Apply Logical Spacing to a mobile app and explain the decision you made.
- Apply Logical Spacing to a creator site and explain the decision you made.
- Apply Logical Spacing to a business landing page and explain the decision you made.
Hands-on example
<div class="ps-6 pe-3">RTL-safe inline padding</div>Expected output
A working responsive example demonstrating Logical Spacing, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Logical Spacing using a different product, screen, component, or content set. Explain what changed and why.
Chapter 5 review — 10 questions and answers
1. What is the main purpose of Padding?
Answer: Padding is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
2. What is a common mistake with Padding?
Answer: Using Padding as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
3. What is the main purpose of Margin?
Answer: Margin is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
4. What is a common mistake with Margin?
Answer: Using Margin as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
5. What is the main purpose of Space Between?
Answer: Space Between is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
6. What is a common mistake with Space Between?
Answer: Using Space Between as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
7. What is the main purpose of Negative Spacing?
Answer: Negative Spacing is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
8. What is a common mistake with Negative Spacing?
Answer: Using Negative Spacing as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
9. What is the main purpose of Logical Spacing?
Answer: Logical Spacing is part of the Tailwind CSS 4.3 workflow. Learn what the underlying CSS property or layout rule does first, then use the utility class to apply that rule consistently in markup.
10. What is a common mistake with Logical Spacing?
Answer: Using Logical Spacing as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.