Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 37 ยท Projects and Practice

Project: A Responsive Landing Page

Build a complete responsive landing page with Tailwind CSS step by step: a mobile navigation, hero section, feature grid, pricing teaser, call to action and footer.

Time to put the whole chapter to work. In this project you will build a landing page for a made-up product, Lumen, a note-taking app. You will use responsive breakpoints, flexbox and grid, state variants, a theme with your own brand color, dark mode, and a touch of animation. We build it in three steps so each one stays small, and the last editor holds the full page that you can read, change and break on purpose.

flowchart TD
  A["1. Theme and navigation"] --> B["2. Hero section"]
  B --> C["3. Features, call to action, footer"]
  C --> E["Full page"]

Build from the top of the page down; test at phone width first.

Plan the design

Before writing classes, decide the rules the page follows. Writing them as tokens keeps the page consistent and makes a redesign a one-line change.

  • Brand color: a violet, defined as --color-brand-* theme tokens.
  • Container: every section content sits in mx-auto max-w-6xl px-4 sm:px-6.
  • Vertical rhythm: sections use py-16 sm:py-24.
  • Type: headings font-bold tracking-tight, body text text-slate-600 dark:text-slate-300.
  • Mobile first: write the phone layout first, then add sm:, md: and lg:.

Step 1: theme and responsive navigation

The navigation shows a menu button on phones and an inline list from md up. A tiny script toggles the mobile menu, and aria-expanded keeps screen readers informed.

Step 1: header with a mobile menu

Notice the two complementary classes: hidden md:flex on the desktop list and md:hidden on the button. Each element is hidden on exactly one side of the breakpoint.

Step 2: the hero

The hero has a headline with gradient text, supporting copy, two buttons and a decorative product card. On a phone everything stacks and centers; from lg up it becomes two columns.

Step 2: hero section

The <i> dots are decorative, so no text or ARIA is needed. The hero's card uses rotate-2 plus the float animation, which a user can disable with the reduced-motion setting.

The features section is a grid with one column on phones, two on sm, three on lg. Each card uses group so the icon reacts when the card is hovered. Below it come a bold call-to-action band and a footer with a link grid. This final editor includes everything from the earlier steps plus a dark mode switch.

Step 3: the complete Lumen page

Review checklist

Run through this list on your own pages before you call them done.

  1. Phone first: is there any horizontal scrollbar at 320px width? If so, look for fixed widths and long words.
  2. Tap targets: buttons and links should be at least 40px tall (py-2 plus text gives about that).
  3. Contrast: brand text on white and on dark must be readable; check brand-600 on white and brand-500 on slate-950.
  4. Keyboard: Tab through the page. Every control needs a visible focus style (add focus-visible: utilities).
  5. Landmarks: header, nav, main, section, footer and one h1 give the page a structure for screen readers.
  6. Reduced motion: decorative animation has motion-reduce:animate-none.

Ideas to extend it

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why does the navigation use both hidden md:flex and md:hidden?

    The desktop nav is hidden by default and appears at md; the menu button is visible by default and hidden at md.
  2. 2. What makes the hero stack on phones and use two columns on large screens?

    A grid has one column by default; lg:grid-cols-2 adds the second from 1024px up.
  3. 3. Why set aria-expanded on the menu button?

    aria-expanded communicates state to screen readers; the script keeps it in sync with the visible menu.
  4. 4. What is the benefit of defining brand colors with @theme?

    Theme tokens generate a whole family of utilities from one place.

Summary

  • Plan tokens (brand color, container, rhythm) before writing classes, and build mobile first.
  • Pair hidden md:flex with md:hidden for a responsive navigation, and keep aria-expanded in sync.
  • Use grids with sm: and lg: column counts, group for hover reactions and motion-reduce: for animation.
  • Review in a checklist: horizontal scroll, tap size, contrast, keyboard, landmarks and reduced motion.

Next: Project: An Admin Dashboard