Log inSign up free
Mastering Modern CSS: From Zero to Pro
  1. Getting started

    1. CSS Lesson 1: What Is CSS?
    2. CSS Lesson 2: Selectors and Rules
    3. CSS Lesson 3: How CSS Works: The Cascade
    4. CSS Lesson 4: Colour and Backgrounds
    5. CSS Lesson 5: Typography and Text
    6. CSS Lesson 6: The Box Model
    7. CSS Lesson 7: Units and Sizing
    8. CSS Lesson 8: Display and Positioning
    9. CSS Lesson 9: Flexbox
    10. CSS Lesson 10: Grid
    11. CSS Lesson 11: Responsive Design
    12. CSS Lesson 12: Final Project
Mastering Modern CSS: From Zero to Pro

Getting started · Lesson 12 of 12 · 7 min read · By Jack

CSS Lesson 12: Final Project

Build a responsive course landing page for CSS from Scratch, using one HTML file with CSS inside a <style> element.

Estimated time: 30 minutes or more
Project: Build a responsive course landing page for CSS from Scratch, using one HTML file with CSS inside a <style> element.

This is the final lesson: you’ve completed all 12 lessons. The project brings together the CSS skills from the course in one practical page.

What you’ll practise

You’ll use semantic HTML, the box model, typography, colour, sizing, positioning, Flexbox, Grid and responsive design together. You’ll also check keyboard focus, image behaviour and layout at different widths.

1. The brief

Create a landing page for a beginner course called CSS from Scratch. It should include:

  • A header with the course name and navigation.
  • An introduction that explains what the course offers.
  • A lesson list or set of lesson cards.
  • A call to action or progress indicator.
  • A footer.

Choose your own copy, colours and layout. The goal is to make the page readable and usable, not to add every visual effect you know.

2. Start with the HTML structure

Create a new file in VS Code called index.html. Add this starter structure, then replace the bracketed notes with your own content:

<!doctype html>  
<html lang="en">  
<head>  
  <meta charset="utf-8">  
  <meta name="viewport" content="width=device-width, initial-scale=1">  
  <title>CSS from Scratch</title>  
  
  <style>  
    /* Add your CSS here */  
  </style>  
</head>  
<body>  
  <header class="site-header">  
    <!-- Course name and navigation -->  
  </header>  
  
  <main>  
    <section class="intro">  
      <!-- Course introduction and main action -->  
    </section>  
  
    <section class="lessons" aria-labelledby="lessons-title">  
      <h2 id="lessons-title">Course lessons</h2>  
      <!-- Lesson cards or list -->  
    </section>  
  </main>  
  
  <footer class="site-footer">  
    <!-- Footer content -->  
  </footer>  
</body>  
</html>

Use headings in a sensible order: usually one main <h1> for the page, then <h2> headings for the major sections, with lower-level headings for content inside them.

3. Establish your CSS foundation

Start with a small reset and base styles. A few consistent choices make the rest of your styling easier to manage.

*,  
*::before,  
*::after {  
  box-sizing: border-box;  
}  
  
body {  
  margin: 0;  
  font-family: Arial, sans-serif;  
  line-height: 1.5;  
}  
  
img {  
  display: block;  
  max-width: 100%;  
  height: auto;  
}

Now choose a small palette and spacing scale. You can write these values directly in your rules, or use CSS custom properties if you’re comfortable with them.

:root {  
  --ink: #172033;  
  --surface: #ffffff;  
  --page: #f4f7fb;  
  --accent: #2563eb;  
  --space: 1rem;  
}

Custom properties are optional. What matters is using colours and spacing consistently.

Quick check 1: Why is box-sizing: border-box useful when you set widths?

4. Build a readable header with Flexbox

The header is a good place to use Flexbox because its content usually sits along one row.

.site-header {  
  display: flex;  
  align-items: center;  
  justify-content: space-between;  
  gap: 1rem;  
  padding: 1rem;  
}

If the items become crowded on a narrow screen, let them wrap:

.site-header {  
  flex-wrap: wrap;  
}

Use meaningful link text. A link labelled “Lessons” is clearer than “Click here”.

5. Style the introduction

Give the introduction a clear hierarchy: a main heading, a short explanation and an action link or button.

.intro {  
  padding: 3rem 1rem;  
}  
  
.intro h1 {  
  font-size: clamp(2rem, 5vw, 4rem);  
  line-height: 1.1;  
}  
  
.intro p {  
  max-width: 42rem;  
}

clamp() lets the heading scale fluidly within a minimum and maximum. The maximum width on the paragraph helps keep long lines comfortable to read.

6. Lay out lesson cards with Grid

Grid is useful for a group of cards because you can control rows and columns.

.lessons {  
  padding: 1rem;  
}  
  
.lesson-grid {  
  display: grid;  
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));  
  gap: 1rem;  
}

Each lesson card should have a clear title and short description. If you include a badge such as “Start here”, position it inside the card:

.lesson-card {  
  position: relative;  
  padding: 1.25rem;  
  border: 1px solid #d5dce8;  
  border-radius: 0.75rem;  
  background: #ffffff;  
}  
  
.lesson-card__badge {  
  position: absolute;  
  top: 0.75rem;  
  right: 0.75rem;  
}

Because the card is position: relative, the absolutely positioned badge uses the card as its anchor. Make sure it doesn’t cover the heading or other important content.

7. Add a responsive change

The auto-fitting Grid above will change the number of columns as space allows. You can also add a media query when your design needs a deliberate change at a particular width:

@media (min-width: 48rem) {  
  .intro {  
    padding: 5rem 2rem;  
  }  
}

Treat 48rem as a starting example, not a device rule. Resize the page and choose a breakpoint where your content needs more room.

Keep the main content from becoming too wide:

main {  
  width: min(100% - 2rem, 72rem);  
  margin-inline: auto;  
}

8. Make the page usable

Before adding decorative details, check these basics:

  • Does the page have a useful title and a logical heading structure?
  • Do links and buttons say what they do?
  • Can you see keyboard focus when you tab through the page?
  • Is there enough contrast between text and its background?
  • Do images fit their containers without distortion?
  • Does the page work when zoomed in?
  • Is there any horizontal scrolling on a narrow screen?

A simple visible focus style can help keyboard users see where they are:

a:focus-visible,  
button:focus-visible {  
  outline: 3px solid #f97316;  
  outline-offset: 3px;  
}

9. Build and test in stages

Work in short steps, checking the page in your browser after each major change:

  1. Add the semantic HTML and your page copy.
  2. Set the base type, colours, box sizing and spacing.
  3. Style the header and introduction.
  4. Build the lesson cards with Grid.
  5. Add a Flexbox component and one positioned detail.
  6. Adjust the design for narrower screens.
  7. Test narrow, intermediate and wide widths.
  8. Check keyboard focus, zoom, images and overflow.
  9. Tidy repeated CSS and save your final version.

Exercises

Try these before opening the answer key.

1. In your own words, explain why the universal box-sizing rule is useful.

2. Identify one part of your page that suits Flexbox and one that suits Grid. Explain why each is a good fit.

3. Add a badge to one lesson card. What needs to be true of the card for the badge to position itself relative to it?

4. Make your main heading scale with the viewport, but keep a sensible minimum and maximum size.

5. Check your page at three widths: narrow, intermediate and wide. Record one issue you find and the change you make to fix it.

6. Use only the keyboard to navigate the page. Can you see which link or button is focused?

7. Finish the project. Complete the acceptance checklist below, then use the CSV rubric to review your page.

Acceptance checklist

  • The file opens directly in a browser.
  • The page has a course title, introduction and lesson content.
  • The page uses Grid and Flexbox for appropriate layout tasks.
  • Any positioned detail is anchored deliberately and does not obscure content.
  • The layout adapts to narrow, intermediate and wide widths.
  • Images stay within their containers and keep their proportions.
  • Headings, links and controls are clear and meaningful.
  • Keyboard focus is visible.
  • There is no unexplained horizontal overflow.
  • The CSS is readable enough to update later.

Key takeaways

  • Start with the page structure and content before polishing the visual details.
  • Use Grid for two-dimensional layout and Flexbox for one-dimensional components.
  • Responsive design includes fluid sizing and testing between breakpoints.
  • Positioning is most predictable when you deliberately establish the anchor.
  • Review accessibility and usability alongside appearance.

Quick check 1: With border-box, an element’s declared width includes its padding and border. That makes the final box size easier to reason about.

Exercise 1: It makes the declared width include padding and border, rather than adding them outside the width.

Exercise 2: Answers vary. A navigation bar is often a good Flexbox use because it arranges items along one line. A lesson-card collection is often a good Grid use because it forms rows and columns.

Exercise 3: The card should establish a containing block, commonly with position: relative. The badge can then use position: absolute and inset values such as top and right.

Exercise 4: One valid approach is:

h1 {  
  font-size: clamp(2rem, 5vw, 4rem);  
}

Exercise 5: Answers vary. A strong review names a specific issue—for example, cards becoming cramped—and describes a targeted change, such as allowing the grid to wrap or adjusting a breakpoint.

Exercise 6: Use the Tab key to move between links and buttons. If the focus indicator is hard to see, add or improve a :focus-visible style.

Exercise 7: The project is ready for self-review when its structure is understandable, its layout adapts, and its controls remain usable. The rubric is a guide for finding improvements, not a demand to add extra effects.

You’ve now completed the CSS from Scratch course. You can paste your index.html here if you’d like a review against the project checklist.

Keep track of your learning

Create a free account to unlock them and track your progress.

  • Track your progress through every course
  • Take the quizzes and see your score
  • Download the worksheets and resources
  • Get a certificate when you finish

Related reading on our blog

Rather have it done for you?

We build websites for small businesses

Everything in this course is what we do every day for local businesses: fast, mobile-friendly sites that are built to be found on Google. See our web design services or our website packages.