Aral Code

Going Further Lesson 33 of 33

CSS Final Project — Style a Small Business Website

Use everything from the course to style a complete one-page website for a local business — header, hero, menu cards, about section, contact and footer — step by step.

Congratulations on reaching the final lesson! Now you'll use everything you learned — colors, the box model, Flexbox, Grid, responsive design and effects — to style a complete one-page website for a small local business: "Kape't Tinapay", a neighborhood bakery and coffee shop.

The HTML is already written. Your job is the CSS. We'll build it in steps, and the full working version is at the end.

The plan

  1. Base: variables, box-sizing, fonts and colors
  2. Header: logo and menu with Flexbox, sticky at the top
  3. Hero: a big welcome section with a gradient and a call-to-action button
  4. Menu cards: a responsive Grid of products with hover effects
  5. About and contact: two columns on wide screens, one on phones
  6. Footer

Step 1: The base

Start every project with variables and a few resets. This sets the "personality" of the whole site in one place:

:root {
  --brown: #6b3e1f;
  --cream: #fff8ec;
  --gold: #e8a33d;
  --text: #2b1d12;
  --muted: #7a6656;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 18px; }

Step 2: The header

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brown);
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  gap: 12px;
}
.logo { color: white; font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: #f3e3cf; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: rgba(255, 255, 255, 0.12); }

Step 3: The hero

.hero {
  background: linear-gradient(135deg, #7d4a26, #3b2212);
  color: white;
  text-align: center;
  padding: clamp(48px, 10vw, 96px) 0;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 8px; }
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

Step 4: The menu grid

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.item {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.item:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12); }
.item img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #f3e3cf; }

Step 5: Two columns that stack on phones

.two-col { display: grid; gap: 24px; }
@media (min-width: 720px) {
  .two-col { grid-template-columns: 1fr 1fr; align-items: center; }
}

The complete website

Here's everything together. Open it with "Try it yourself", then open it in the Playground for a bigger view.

Example Kape't Tinapay — the finished one-page website
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kape't Tinapay — Bakery & Coffee</title>
<style>
  :root {
    --brown: #6b3e1f;
    --cream: #fff8ec;
    --gold: #e8a33d;
    --text: #2b1d12;
    --muted: #7a6656;
    --radius: 14px;
  }
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--cream); line-height: 1.6; }
  img { max-width: 100%; height: auto; display: block; }
  .container { max-width: 1000px; margin: 0 auto; padding: 0 18px; }

  /* Header */
  .header { position: sticky; top: 0; z-index: 10; background: var(--brown); }
  .header .container { display: flex; justify-content: space-between; align-items: center; min-height: 60px; gap: 12px; }
  .logo { color: white; font-weight: 800; font-size: 1.2rem; text-decoration: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { color: #f3e3cf; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
  .nav a:hover { background: rgba(255, 255, 255, 0.12); }
  @media (max-width: 480px) { .nav a:not(:last-child) { display: none; } }

  /* Hero */
  .hero { background: linear-gradient(135deg, #7d4a26, #3b2212); color: white; text-align: center; padding: clamp(48px, 10vw, 96px) 0; }
  .hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 8px; line-height: 1.15; }
  .hero p { margin: 0 auto 24px; max-width: 46ch; color: #f3e3cf; }
  .btn { display: inline-block; background: var(--gold); color: var(--text); padding: 12px 24px; border-radius: 999px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 16px rgba(0,0,0,0.25); transition: transform 0.2s ease; }
  .btn:hover { transform: translateY(-2px); }

  /* Sections */
  section { padding: 48px 0; }
  h2 { font-size: 1.8rem; margin: 0 0 6px; color: var(--brown); }
  .sub { color: var(--muted); margin: 0 0 24px; }

  /* Menu */
  .menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
  .item { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.25s ease, box-shadow 0.25s ease; }
  .item:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(0,0,0,0.12); }
  .item img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #f3e3cf; }
  .item-body { padding: 12px 14px 16px; }
  .item h3 { margin: 0 0 4px; font-size: 1.1rem; }
  .item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
  .price { display: inline-block; margin-top: 8px; font-weight: 800; color: var(--brown); }

  /* About & contact */
  .about { background: white; }
  .two-col { display: grid; gap: 24px; }
  @media (min-width: 720px) { .two-col { grid-template-columns: 1fr 1fr; align-items: center; } }
  .badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .badge { background: #f3e3cf; color: var(--brown); padding: 4px 12px; border-radius: 999px; font-size: 0.9rem; }
  .info { list-style: none; padding: 0; margin: 0; }
  .info li { padding: 10px 0; border-bottom: 1px dashed #e2cfb8; }
  .info li:last-child { border-bottom: 0; }
  .map { aspect-ratio: 4 / 3; border-radius: var(--radius); background: repeating-linear-gradient(45deg, #f3e3cf 0 12px, #fbefe0 12px 24px); display: grid; place-items: center; color: var(--muted); }

  /* Footer */
  .footer { background: #2b1d12; color: #d8c6b4; text-align: center; padding: 22px 0; font-size: 0.9rem; }
</style>
</head>
<body>
  <header class="header">
    <div class="container">
      <a class="logo" href="#">☕ Kape't Tinapay</a>
      <nav class="nav"><a href="#menu">Menu</a><a href="#about">About</a><a href="#contact">Contact</a></nav>
    </div>
  </header>

  <section class="hero">
    <div class="container">
      <h1>Freshly baked, every single morning.</h1>
      <p>Pandesal straight from the oven at 5 AM, local barako coffee, and merienda favorites just like lola used to make.</p>
      <a class="btn" href="#menu">See today's menu</a>
    </div>
  </section>

  <section id="menu">
    <div class="container">
      <h2>Our Menu</h2>
      <p class="sub">Best with a cup of kapeng barako.</p>
      <div class="menu-grid">
        <article class="item"><img src="/img/halo-halo.svg" alt="Ensaymada"><div class="item-body"><h3>Ensaymada</h3><p>Soft, buttery and topped with cheese.</p><span class="price">₱35</span></div></article>
        <article class="item"><img src="/img/mango.svg" alt="Mango bread"><div class="item-body"><h3>Mango Bread</h3><p>Made with ripe Guimaras mangoes.</p><span class="price">₱45</span></div></article>
        <article class="item"><img src="/img/halo-halo.svg" alt="Pandesal"><div class="item-body"><h3>Pandesal (10 pcs)</h3><p>The classic Filipino breakfast bread.</p><span class="price">₱30</span></div></article>
        <article class="item"><img src="/img/mango.svg" alt="Kapeng barako"><div class="item-body"><h3>Kapeng Barako</h3><p>Strong, bold coffee from Batangas.</p><span class="price">₱40</span></div></article>
      </div>
    </div>
  </section>

  <section id="about" class="about">
    <div class="container two-col">
      <div>
        <h2>Since 1998</h2>
        <p>What started as Aling Cora's small oven in our garage is now the favorite merienda stop of Barangay Mabini. We still use her recipes, and we still knead every batch by hand.</p>
        <div class="badge-row"><span class="badge">🥖 Baked daily</span><span class="badge">🇵🇭 Local ingredients</span><span class="badge">🛵 Delivery</span></div>
      </div>
      <div id="contact">
        <h2>Visit Us</h2>
        <ul class="info">
          <li>📍 123 Rizal St., Brgy. Mabini</li>
          <li>🕔 Open daily, 5:00 AM – 8:00 PM</li>
          <li>📞 0917 000 0000</li>
        </ul>
      </div>
    </div>
  </section>

  <footer class="footer">© 2026 Kape't Tinapay · Made with CSS by a Grade 10 student</footer>
</body>
</html>

Make it your own

Now customize it. Here are challenges, from easy to hard:

  1. Rebrand it. Change only the variables in :root to turn it into a milk tea shop, a sari-sari store or a carinderia.
  2. Add a section. Write a "Customer reviews" section with three quote cards in a grid.
  3. Dark mode. Add a prefers-color-scheme: dark media query that changes the variables.
  4. Animate the hero. Use @keyframes to fade in the heading and slide up the button when the page loads, and respect prefers-reduced-motion.
  5. Real business. Ask a family member or a store in your barangay if you can make a page for their business, with their permission and their real photos.

Before you publish: a checklist

  • ☐ No sideways scrolling on a phone (test at 360px wide)
  • ☐ All text is readable: at least 16px, good contrast
  • ☐ Every image has alt text and doesn't overflow
  • ☐ Buttons and links are easy to tap and have a visible focus style
  • ☐ The layout works on phone, tablet and laptop widths
  • ☐ CSS is in an external style.css file, with comments for each section

Then publish it for free, following the steps in the HTML course's Publishing lesson.

Quick Quiz

Check what you learned. Walang grade ito, practice lang. 🙂

1. In the project, which layout tool arranges the logo and menu in the header?
2. Which line makes the menu cards responsive without media queries?
3. What is the fastest way to change the whole site's color scheme?
4. Why is position: sticky used on the header?

By Sir Reyel · Last updated 2026-12-04