Tailwind CSS · module 2 of 9
Spacing & Typography
Control axis spacing, stacks, font size, weight, line height, width constraints, and readable rhythm.
What this module covers
5 steps · Tailwind CSS
Step 1. Lesson: Spacing & Typography
Control axis spacing, stacks, font size, weight, line height, width constraints, and readable rhythm. Learning objectives - Recognize when spacing & typography is the right tool. - Explain the role of space-y-, font-, leading-. - Build a small working example before combining it with a larger interface. - Identify one accessibility, maintainability, or error-handling improvement. Read the example, predict what it will do, then complete the small change described in the check question.
Control axis spacing, stacks, font size, weight, line height, width constraints, and readable rhythm. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.
Check yourself: [HTML + CSS] Use the example to demonstrate spacing & typography.
Step 2. Quiz: Spacing & Typography
Check your understanding of Spacing & Typography.
space-y-* adds vertical space between direct child elements. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.
Check yourself: [HTML + CSS] Complete the knowledge check.
Step 3. Exercise: Spacing & Typography
Create a readable article card with a constrained width, vertical rhythm, type scale, and relaxed body copy.
This exercise turns the Spacing & Typography lesson into a working code change. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.
Check yourself: [HTML + CSS] Does the solution use space-y- and font- and leading-?
Step 4. Review lab: Explain & improve Spacing & Typography
Rebuild the exercise without copying the solution. Then improve it in two ways: make the code easier to understand and add one useful edge case, responsive behavior, accessibility improvement, or error state. Finally, write a short explanation of how space-y-, font-, leading- work together.
Rebuilding from memory and improving an edge case turns recognition into durable skill. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.
Check yourself: [HTML + CSS] Does the improved version still use space-y-, font-, leading- clearly?
Step 5. Mini project: Spacing & Typography
Build a responsive editorial page with a consistent spacing scale and typography hierarchy.
The mini project combines the module lesson, quiz, and exercise into one portfolio-ready result. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.
Check yourself: [HTML + CSS] Does the project apply the module's spacing & typography skills?
Loading code lab...