Your landing page project

In this lesson, you'll build a complete landing page for a fictional SaaS product. The page will include:

  • Hero section with a background gradient, centered text, and a prominent CTA button
  • Features grid with 3โ€“4 feature cards arranged responsively
  • Testimonials section with social proof cards in a flexbox row
  • Pricing cards with 3 tiers, highlighting the "popular" tier with a BEM modifier
  • Footer with multiple columns and links
Pro tip:
A landing page is the first chance to make an impression. Clean layout, fast load times, and clear hierarchy win customers.

Step 1: CSS variables foundation

Before writing any layout CSS, define your design system using CSS custom properties (variables). This keeps your page consistent and makes changes easy.

styles.css CSS variables for colors, spacing, fonts

Notice how variables like --primary and --spacing-md replace hard-coded values. Now you can change the entire color scheme in one place!

Step 2: Hero section with gradient and flexbox

The hero is your page's first impression. It uses a gradient background, centered text, and a button with hover effects.

hero.css Hero section: gradient, centering, and button
Flexbox centering:
display: flex; align-items: center; justify-content: center; centers content both horizontally and vertically. The holy grail of centering!

Step 3: Features grid with CSS Grid and responsive design

Features are best shown in a grid. CSS Grid with auto-fill or auto-fit makes it responsive without media queries.

features.css Feature cards in a responsive CSS Grid

The key is grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)). This says: "Fill the grid with as many 280px-wide columns as fit, then stretch them equally." No media queries needed!

Step 4: Pricing cards with BEM modifier for "popular"

BEM (Block Element Modifier) is a naming convention that makes CSS scalable and readable. Let's use it for pricing cards.

pricing.css Pricing cards with BEM naming
BEM Breakdown:
Block = .pricing (container), Element = .pricing__card (child), Modifier = .pricing__card--popular (variation). Naming is long but super clear!

Try it yourself: Hero + Features grid

Build the hero section and features grid. Use variables, gradient, flexbox, and CSS Grid. Click Run to see the result in real-time.

โœ๏ธ Editor 1: Hero & Features
Preview

Try it yourself: Testimonials, Pricing, & Footer

Now add testimonials in a flex row, 3 pricing tiers (highlight "popular" with a BEM modifier), and a footer with columns.

โœ๏ธ Editor 2: Pricing & More
Preview
Challenge: Enhanced Landing Page

Task: Take the editors above and add:

  • A smooth scroll-to-section behavior when buttons or links are clicked (you can use anchor links or JavaScript)
  • A responsive hamburger menu that appears on mobile (nav collapses into a toggle menu)
  • Hover animations on buttons and cards (transitions, transforms, shadows)
  • A newsletter signup section between testimonials and pricing
  • Mobile-first responsive design with one or two breakpoints

Hint: Use scroll-behavior: smooth; on the html element for automatic scroll behavior. For the hamburger menu, hide the full nav on mobile with display: none; and show a toggle button instead. Use @media (max-width: 768px) for your breakpoint. Animations work best with transition: all 0.3s ease; on hover states.

Key patterns you learned

  • CSS Variables: Define once, use everywhere. Changes cascade automatically.
  • Flexbox for rows: display: flex; gap: var(--spacing-lg); for aligned, spaced content.
  • CSS Grid for grids: grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); for responsive grids without media queries.
  • BEM naming: .block__element--modifier keeps CSS organized and scalable.
  • Hover transforms: transform: translateY(-8px); box-shadow: 0 12px 24px rgba(...); adds depth and interactivity.
  • Gradients: background: linear-gradient(135deg, color1, color2); for modern, polished backgrounds.
  • Responsive design: Use clamp() for responsive fonts and grid auto-fit for flexible layouts.

Test your knowledge

Question 1 of 5
What CSS property creates a gradient background?
Question 2 of 5
In BEM naming, how do you highlight the "popular" pricing card?
Question 3 of 5
Which CSS property works best for a responsive features grid?
Question 4 of 5
How do you center content horizontally AND vertically with Flexbox?
Question 5 of 5
What makes a CTA button interactive on hover?
0
/5
Great work! You're ready to build landing pages.

What's next?

Next lesson: Build a Portfolio Website โ†’ โ€” Combine HTML & CSS to create a multi-page personal portfolio with projects, about, and contact sections.

You've now mastered responsive design, CSS Grid, Flexbox, and professional naming conventions. You're ready to tackle real-world projects!

Africa & India's Best AI Academy
๐Ÿค– AI-first ๐ŸŽ“ Placement Assistance

You just built a professional landing page.
Next stop: full-stack web development.

Join the Best AI Programs โ€” three 5-month courses, fully online, with placement assistance. Week 1 is free.

Explore our AI-era courses โ†’