8.1 flex
flex 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 flex.
- 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 flex to a course website and explain the decision you made.
- Apply flex to a online store and explain the decision you made.
- Apply flex to a banking app and explain the decision you made.
- Apply flex to a school portal and explain the decision you made.
- Apply flex to a clinic booking system and explain the decision you made.
- Apply flex to a dashboard and explain the decision you made.
- Apply flex to a restaurant site and explain the decision you made.
- Apply flex to a mobile app and explain the decision you made.
- Apply flex to a creator site and explain the decision you made.
- Apply flex 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">flex</span>
</div>Expected output
A working responsive example demonstrating flex, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for flex using a different product, screen, component, or content set. Explain what changed and why.
8.2 Flex Direction
Flex Direction 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 Flex Direction.
- 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 Flex Direction to a course website and explain the decision you made.
- Apply Flex Direction to a online store and explain the decision you made.
- Apply Flex Direction to a banking app and explain the decision you made.
- Apply Flex Direction to a school portal and explain the decision you made.
- Apply Flex Direction to a clinic booking system and explain the decision you made.
- Apply Flex Direction to a dashboard and explain the decision you made.
- Apply Flex Direction to a restaurant site and explain the decision you made.
- Apply Flex Direction to a mobile app and explain the decision you made.
- Apply Flex Direction to a creator site and explain the decision you made.
- Apply Flex Direction to a business landing page and explain the decision you made.
Hands-on example
<div class="flex flex-col md:flex-row gap-4">...</div>Expected output
A working responsive example demonstrating Flex Direction, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Flex Direction using a different product, screen, component, or content set. Explain what changed and why.
8.3 Flex Wrap
Flex Wrap 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 Flex Wrap.
- 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 Flex Wrap to a course website and explain the decision you made.
- Apply Flex Wrap to a online store and explain the decision you made.
- Apply Flex Wrap to a banking app and explain the decision you made.
- Apply Flex Wrap to a school portal and explain the decision you made.
- Apply Flex Wrap to a clinic booking system and explain the decision you made.
- Apply Flex Wrap to a dashboard and explain the decision you made.
- Apply Flex Wrap to a restaurant site and explain the decision you made.
- Apply Flex Wrap to a mobile app and explain the decision you made.
- Apply Flex Wrap to a creator site and explain the decision you made.
- Apply Flex Wrap 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">Flex Wrap</span>
</div>Expected output
A working responsive example demonstrating Flex Wrap, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Flex Wrap using a different product, screen, component, or content set. Explain what changed and why.
8.4 Grow and Shrink
Grow and Shrink 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 Grow and Shrink.
- 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 Grow and Shrink to a course website and explain the decision you made.
- Apply Grow and Shrink to a online store and explain the decision you made.
- Apply Grow and Shrink to a banking app and explain the decision you made.
- Apply Grow and Shrink to a school portal and explain the decision you made.
- Apply Grow and Shrink to a clinic booking system and explain the decision you made.
- Apply Grow and Shrink to a dashboard and explain the decision you made.
- Apply Grow and Shrink to a restaurant site and explain the decision you made.
- Apply Grow and Shrink to a mobile app and explain the decision you made.
- Apply Grow and Shrink to a creator site and explain the decision you made.
- Apply Grow and Shrink 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">Grow and Shrink</span>
</div>Expected output
A working responsive example demonstrating Grow and Shrink, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Grow and Shrink using a different product, screen, component, or content set. Explain what changed and why.
8.5 Flex Basis
Flex Basis 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 Flex Basis.
- 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 Flex Basis to a course website and explain the decision you made.
- Apply Flex Basis to a online store and explain the decision you made.
- Apply Flex Basis to a banking app and explain the decision you made.
- Apply Flex Basis to a school portal and explain the decision you made.
- Apply Flex Basis to a clinic booking system and explain the decision you made.
- Apply Flex Basis to a dashboard and explain the decision you made.
- Apply Flex Basis to a restaurant site and explain the decision you made.
- Apply Flex Basis to a mobile app and explain the decision you made.
- Apply Flex Basis to a creator site and explain the decision you made.
- Apply Flex Basis 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">Flex Basis</span>
</div>Expected output
A working responsive example demonstrating Flex Basis, with no page-wide overflow and clear behavior across breakpoints.
Practice exercise
Create a fresh example for Flex Basis using a different product, screen, component, or content set. Explain what changed and why.
Chapter 8 review — 10 questions and answers
1. What is the main purpose of flex?
Answer: flex 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 flex?
Answer: Using flex as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
3. What is the main purpose of Flex Direction?
Answer: Flex Direction 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 Flex Direction?
Answer: Using Flex Direction as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
5. What is the main purpose of Flex Wrap?
Answer: Flex Wrap 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 Flex Wrap?
Answer: Using Flex Wrap as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
7. What is the main purpose of Grow and Shrink?
Answer: Grow and Shrink 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 Grow and Shrink?
Answer: Using Grow and Shrink as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.
9. What is the main purpose of Flex Basis?
Answer: Flex Basis 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 Flex Basis?
Answer: Using Flex Basis as memorized class names without understanding the CSS behavior, responsive context, accessibility, or component structure.