EthicsComputerCourses
Join training +91 90532 10052

Project: Advanced Multi-Page Business Website

HTML · Lesson 80 of 234 Project 14 min read Updated

By the end of this project you will have built a complete four-page website for a small local business. Every page shares one header, menu and footer, has its own title, description and share preview, and passes a keyboard test. Along the way you will use almost every Level 2 skill: metadata, Open Graph, structured data, native form validation, <details>, <dialog>, responsive images and landmarks.

The business is Gulabi Oven, a made-up bakery in Malviya Nagar, Jaipur, run by Meera and Kabir Sharma. Swap in a real business you know, such as a coaching institute in Rohtak or a tailor in Pune, as you go. The Level 1 project, Mini Project: Personal Portfolio Website, was a single page. This one is a real site, so the new challenge is keeping several pages consistent.

What you will build

A visitor should be able to see what the bakery sells, read about it and order a cake. That gives four pages:

PageFileMain jobLevel 2 skills used
Homeindex.htmlSay what the bakery is and show today's favouritesJSON-LD, responsive hero image, Open Graph
Menuservices.htmlList cakes, breads and prices, answer common questionsPrice table, <details name> FAQ
Aboutabout.htmlTell the bakery's story<picture> art direction, <figure>
Contactcontact.htmlAddress, hours and an order formNative validation, <dialog>

All four pages share the same skeleton: a skip link, a site header with the logo and main menu, a <main> region, and a footer with the address. Only the head values and the inside of <main> change. This is the template and content split you planned in Advanced HTML5 Architecture.

Step 1: Plan the folders and the shared parts

Create one folder for the site. Keep file names lowercase with hyphens, and keep each kind of file in its own folder.

Text
gulabi-oven/
├── index.html
├── services.html
├── about.html
├── contact.html
├── favicon.ico            32 x 32, for old browsers and tools
├── icon.svg               main browser tab icon
├── apple-touch-icon.png   180 x 180, iPhone home screen
├── site.webmanifest
├── css/
│   └── style.css          one stylesheet for every page
└── images/
    ├── logo.svg
    ├── shop-400.jpg       small hero image
    ├── shop-800.jpg       large hero image
    ├── kitchen-tall.jpg   about page, narrow screens
    └── share.jpg          1200 x 630 link preview image

Next, decide what changes from page to page. Write it as a small table before you type any HTML. A table like this stops two pages from ending up with the same title, which is one of the most common mistakes on small business sites.

Page<title>Canonical URLaria-current on
HomeGulabi Oven | Fresh cakes and breads in Malviya Nagar, Jaipurhttps://gulabioven.example/Home
MenuCakes, breads and prices | Gulabi Ovenhttps://gulabioven.example/services.htmlMenu
AboutOur story | Gulabi Ovenhttps://gulabioven.example/about.htmlAbout
ContactContact us and order a cake | Gulabi Ovenhttps://gulabioven.example/contact.htmlContact

The .example domain is reserved for documentation, so it can never belong to a real business. Use your real domain when you publish. The canonical URL and the og:url of each page must be the same absolute address.

The shared stylesheet is short. Save it as css/style.css:

CSS
:root { --rose: #a3245c; --ink: #222; --cream: #fff8f3; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.5; }
.skip { position: absolute; left: 8px; top: -60px; background: #111; color: #fff; padding: 8px 12px; }
.skip:focus { top: 8px; }
.site-header, main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header ul, .site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
nav a { color: var(--rose); }
nav a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--rose); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.site-footer { border-top: 1px solid #e5d3c8; font-size: 0.9rem; }

Notice that the current menu link is styled with the attribute selector a[aria-current="page"]. The same attribute that tells a screen reader "this is the current page" also drives the visual style, so the two can never disagree. There is no separate active class to forget.

Step 2: The home page

The home page carries the full head. Read it line by line, because the other three pages repeat the same pattern with different values.

In the body, the hero image uses srcset and sizes, so a phone downloads the 400-pixel file and a laptop the 800-pixel one. It is the first big image, so it is not lazy loaded. The cards further down are.

In the Try-it versions, the shared CSS is pasted into a <style> element so each page runs on its own, and images come from the course's sample files. The menu links will not open other pages inside the editor. Save the four files in one folder and open index.html to click between them.

HTMLOpen in editor
<!DOCTYPE html>
<html lang="en-IN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Gulabi Oven | Fresh cakes and breads in Malviya Nagar, Jaipur</title>
  <meta name="description" content="Eggless and regular cakes, breads and cookies baked fresh every morning in Malviya Nagar, Jaipur. Order birthday cakes a day ahead.">
  <link rel="canonical" href="https://gulabioven.example/">
  <link rel="icon" href="favicon.ico" sizes="32x32">
  <link rel="icon" href="icon.svg" type="image/svg+xml">
  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="manifest" href="site.webmanifest">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Gulabi Oven">
  <meta property="og:locale" content="en_IN">
  <meta property="og:title" content="Gulabi Oven, a neighbourhood bakery in Jaipur">
  <meta property="og:description" content="Fresh cakes and breads every morning. Order birthday cakes a day ahead.">
  <meta property="og:url" content="https://gulabioven.example/">
  <meta property="og:image" content="https://gulabioven.example/images/share.jpg">
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
  <meta property="og:image:alt" content="A pink-iced cake on the counter of Gulabi Oven">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="stylesheet" href="css/style.css">
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Bakery",
    "name": "Gulabi Oven",
    "url": "https://gulabioven.example/",
    "image": "https://gulabioven.example/images/share.jpg",
    "telephone": "+91-90000-00000",
    "priceRange": "₹₹",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Shop 4, Sector 7, Malviya Nagar",
      "addressLocality": "Jaipur",
      "addressRegion": "Rajasthan",
      "postalCode": "302017",
      "addressCountry": "IN"
    },
    "openingHoursSpecification": [
      {
        "@type": "OpeningHoursSpecification",
        "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
        "opens": "08:00",
        "closes": "21:00"
      },
      {
        "@type": "OpeningHoursSpecification",
        "dayOfWeek": "Sunday",
        "opens": "09:00",
        "closes": "14:00"
      }
    ]
  }
  </script>
  <style>
    :root { --rose: #a3245c; --ink: #222; --cream: #fff8f3; }
    * { box-sizing: border-box; }
    body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.5; }
    .skip { position: absolute; left: 8px; top: -60px; background: #111; color: #fff; padding: 8px 12px; }
    .skip:focus { top: 8px; }
    .site-header, main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 1rem; }
    .site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
    .site-header ul, .site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
    nav a { color: var(--rose); }
    nav a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--rose); }
    img { max-width: 100%; height: auto; }
    :focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
    .site-footer { border-top: 1px solid #e5d3c8; font-size: 0.9rem; }
    .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
    .cards article { background: #fff; padding: 0.75rem; border-radius: 8px; }
  </style>
</head>
<body>
  <a class="skip" href="#main">Skip to main content</a>
  <header class="site-header">
    <a href="index.html"><img src="https://course.ethicscomputer.in/assets/samples/logo.svg" alt="Gulabi Oven home" width="240" height="80"></a>
    <nav aria-label="Main">
      <ul>
        <li><a href="index.html" aria-current="page">Home</a></li>
        <li><a href="services.html">Menu</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>

  <main id="main" tabindex="-1">
    <h1>Fresh cakes and breads, baked every morning in Malviya Nagar</h1>
    <p>Eggless and regular cakes, soft pav, atta bread and nankhatai. Order a birthday cake a day ahead and collect it warm.</p>
    <img src="https://course.ethicscomputer.in/assets/samples/landscape-400.svg"
         srcset="https://course.ethicscomputer.in/assets/samples/landscape-400.svg 400w, https://course.ethicscomputer.in/assets/samples/landscape.svg 800w"
         sizes="(min-width: 60rem) 58rem, 100vw"
         width="800" height="500" fetchpriority="high"
         alt="The Gulabi Oven counter with cakes and bread loaves on wooden shelves">

    <section aria-labelledby="favourites">
      <h2 id="favourites">Today's favourites</h2>
      <div class="cards">
        <article>
          <img src="https://course.ethicscomputer.in/assets/samples/landscape-400.svg" width="400" height="250" loading="lazy" alt="Slice of chocolate truffle cake">
          <h3>Chocolate truffle cake</h3>
          <p>Eggless, half kg, ₹649</p>
        </article>
        <article>
          <img src="https://course.ethicscomputer.in/assets/samples/landscape-400.svg" width="400" height="250" loading="lazy" alt="Two loaves of whole wheat bread">
          <h3>Atta bread</h3>
          <p>400 g loaf, ₹70</p>
        </article>
      </div>
    </section>

    <section aria-labelledby="visit">
      <h2 id="visit">Visit us</h2>
      <p>Open 8 am to 9 pm, Monday to Saturday, and 9 am to 2 pm on Sunday. <a href="contact.html">Find us or order a cake</a>.</p>
    </section>
  </main>

  <footer class="site-footer">
    <address>
      Gulabi Oven, Shop 4, Sector 7, Malviya Nagar, Jaipur 302017<br>
      Phone: <a href="tel:+919000000000">+91 90000 00000</a>
    </address>
    <nav aria-label="Footer">
      <ul>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
    <p>&copy; 2026 Gulabi Oven</p>
  </footer>
</body>
</html>

Press Tab once: the skip link appears. Press Enter, then Tab again, and focus moves into the page content instead of the menu. Narrow the preview and the menu wraps instead of overflowing. The bold, underlined Home link is the current page.

Step 3: The menu page with a price table and FAQ

The menu page keeps the same header and footer. Only three things change in the shell: the title and other head values, and which link carries aria-current="page".

The prices are real tabular data (item, size, price), so they go in a <table> with a caption, not in a list of <div> elements. The FAQ uses <details> elements that share name="faq", so opening one answer closes the others, as you learnt in Details & Summary Elements. The answers stay in the HTML, so search engines and the browser's find-in-page can still read them.

HTMLOpen in editor
<!DOCTYPE html>
<html lang="en-IN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Cakes, breads and prices | Gulabi Oven</title>
  <meta name="description" content="Prices for cakes, breads and cookies at Gulabi Oven, Jaipur, with answers about eggless baking, custom designs and same-day orders.">
  <link rel="canonical" href="https://gulabioven.example/services.html">
  <link rel="icon" href="favicon.ico" sizes="32x32">
  <link rel="icon" href="icon.svg" type="image/svg+xml">
  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="manifest" href="site.webmanifest">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Gulabi Oven">
  <meta property="og:locale" content="en_IN">
  <meta property="og:title" content="Gulabi Oven menu and prices">
  <meta property="og:description" content="Cakes from ₹549, fresh bread from ₹45. Eggless options for every cake.">
  <meta property="og:url" content="https://gulabioven.example/services.html">
  <meta property="og:image" content="https://gulabioven.example/images/share.jpg">
  <meta property="og:image:alt" content="A pink-iced cake on the counter of Gulabi Oven">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="stylesheet" href="css/style.css">
  <style>
    :root { --rose: #a3245c; --ink: #222; --cream: #fff8f3; }
    * { box-sizing: border-box; }
    body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.5; }
    .skip { position: absolute; left: 8px; top: -60px; background: #111; color: #fff; padding: 8px 12px; }
    .skip:focus { top: 8px; }
    .site-header, main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 1rem; }
    .site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
    .site-header ul, .site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
    nav a { color: var(--rose); }
    nav a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--rose); }
    img { max-width: 100%; height: auto; }
    :focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
    .site-footer { border-top: 1px solid #e5d3c8; font-size: 0.9rem; }
    table { border-collapse: collapse; width: 100%; background: #fff; }
    th, td { border: 1px solid #e5d3c8; padding: 6px 8px; text-align: left; }
    details { background: #fff; margin-block: 6px; padding: 8px 12px; border-radius: 6px; }
    summary { cursor: pointer; font-weight: 600; }
  </style>
</head>
<body>
  <a class="skip" href="#main">Skip to main content</a>
  <header class="site-header">
    <a href="index.html"><img src="https://course.ethicscomputer.in/assets/samples/logo.svg" alt="Gulabi Oven home" width="240" height="80"></a>
    <nav aria-label="Main">
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="services.html" aria-current="page">Menu</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>

  <main id="main" tabindex="-1">
    <h1>Cakes, breads and prices</h1>

    <section aria-labelledby="price-list">
      <h2 id="price-list">Price list</h2>
      <table>
        <caption>Prices include GST. Every cake is available eggless.</caption>
        <thead>
          <tr><th scope="col">Item</th><th scope="col">Size</th><th scope="col">Price</th></tr>
        </thead>
        <tbody>
          <tr><th scope="row">Pineapple cake</th><td>500 g</td><td>₹549</td></tr>
          <tr><th scope="row">Chocolate truffle cake</th><td>500 g</td><td>₹649</td></tr>
          <tr><th scope="row">Rasmalai fusion cake</th><td>1 kg</td><td>₹1,299</td></tr>
          <tr><th scope="row">Atta bread</th><td>400 g</td><td>₹70</td></tr>
          <tr><th scope="row">Ladi pav</th><td>6 pieces</td><td>₹45</td></tr>
        </tbody>
      </table>
    </section>

    <section aria-labelledby="faq">
      <h2 id="faq">Frequently asked questions</h2>
      <details name="faq" open>
        <summary>Are your eggless cakes made in a separate kitchen?</summary>
        <p>They are made on separate counters with separate tools, in the same kitchen.</p>
      </details>
      <details name="faq">
        <summary>Can you print a photo on a cake?</summary>
        <p>Yes. Send the photo with your order and allow one extra day.</p>
      </details>
      <details name="faq">
        <summary>Do you take same-day orders?</summary>
        <p>For cakes on the price list, yes, if you order before 11 am.</p>
      </details>
    </section>
  </main>

  <footer class="site-footer">
    <address>
      Gulabi Oven, Shop 4, Sector 7, Malviya Nagar, Jaipur 302017<br>
      Phone: <a href="tel:+919000000000">+91 90000 00000</a>
    </address>
    <nav aria-label="Footer">
      <ul>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
    <p>&copy; 2026 Gulabi Oven</p>
  </footer>
</body>
</html>

Open the second question: the first one closes by itself. Each row header uses <th scope="row">, so a screen reader announces "Atta bread, Price, ₹70" instead of a bare number.

Step 4: The about page with art direction

On a wide screen a landscape photo of the shop works well. On a narrow phone it becomes a thin strip where nobody can see the bakers. <picture> fixes this with art direction: a different crop for a different screen, as in Responsive Images: Picture & Srcset. The width and height on each <source> let the browser reserve the right space for whichever image it picks.

HTMLOpen in editor
<!DOCTYPE html>
<html lang="en-IN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Our story | Gulabi Oven</title>
  <meta name="description" content="How Meera and Kabir Sharma turned a home kitchen in Jaipur into Gulabi Oven, a neighbourhood bakery known for eggless cakes.">
  <link rel="canonical" href="https://gulabioven.example/about.html">
  <link rel="icon" href="favicon.ico" sizes="32x32">
  <link rel="icon" href="icon.svg" type="image/svg+xml">
  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="manifest" href="site.webmanifest">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Gulabi Oven">
  <meta property="og:locale" content="en_IN">
  <meta property="og:title" content="The story of Gulabi Oven">
  <meta property="og:description" content="From a home kitchen to a Malviya Nagar bakery in five years.">
  <meta property="og:url" content="https://gulabioven.example/about.html">
  <meta property="og:image" content="https://gulabioven.example/images/share.jpg">
  <meta property="og:image:alt" content="A pink-iced cake on the counter of Gulabi Oven">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="stylesheet" href="css/style.css">
  <style>
    :root { --rose: #a3245c; --ink: #222; --cream: #fff8f3; }
    * { box-sizing: border-box; }
    body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.5; }
    .skip { position: absolute; left: 8px; top: -60px; background: #111; color: #fff; padding: 8px 12px; }
    .skip:focus { top: 8px; }
    .site-header, main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 1rem; }
    .site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
    .site-header ul, .site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
    nav a { color: var(--rose); }
    nav a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--rose); }
    img { max-width: 100%; height: auto; }
    :focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
    .site-footer { border-top: 1px solid #e5d3c8; font-size: 0.9rem; }
    figure { margin: 0; }
    figcaption { font-size: 0.9rem; color: #555; }
  </style>
</head>
<body>
  <a class="skip" href="#main">Skip to main content</a>
  <header class="site-header">
    <a href="index.html"><img src="https://course.ethicscomputer.in/assets/samples/logo.svg" alt="Gulabi Oven home" width="240" height="80"></a>
    <nav aria-label="Main">
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="services.html">Menu</a></li>
        <li><a href="about.html" aria-current="page">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>

  <main id="main" tabindex="-1">
    <h1>Our story</h1>
    <figure>
      <picture>
        <source media="(min-width: 40rem)" srcset="https://course.ethicscomputer.in/assets/samples/landscape.svg" width="800" height="500">
        <img src="https://course.ethicscomputer.in/assets/samples/portrait.svg" width="400" height="600"
             alt="Meera and Kabir Sharma shaping dough at the bakery table">
      </picture>
      <figcaption>Meera and Kabir start baking at 5 am every day.</figcaption>
    </figure>
    <p>Meera Sharma began baking eggless cakes for neighbours in 2021, in a home kitchen with one small oven. Within a year the orders filled the whole fridge.</p>
    <p>In 2024 she and her brother Kabir opened Gulabi Oven in Malviya Nagar. The name comes from the pink walls of the old city.</p>
    <section aria-labelledby="promise">
      <h2 id="promise">What we promise</h2>
      <ul>
        <li>Everything is baked on the day it is sold.</li>
        <li>Every cake has an eggless version at the same price.</li>
        <li>No artificial colours in our pink icing: it comes from beetroot.</li>
      </ul>
    </section>
  </main>

  <footer class="site-footer">
    <address>
      Gulabi Oven, Shop 4, Sector 7, Malviya Nagar, Jaipur 302017<br>
      Phone: <a href="tel:+919000000000">+91 90000 00000</a>
    </address>
    <nav aria-label="Footer">
      <ul>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
    <p>&copy; 2026 Gulabi Oven</p>
  </footer>
</body>
</html>

Make the preview wider than about 640 pixels and the image switches from the tall crop to the wide one. The alt text stays on the <img>, because <source> elements never carry alt.

Step 5: The contact page with an order form and dialog

This page has three jobs: show where the bakery is, show the opening hours, and take cake orders. The form uses only built-in validation from Form Validation Basics and Native HTML Form Validation:

  • required on every field the bakery truly needs.
  • type="tel" with pattern="[6-9][0-9]{9}" for a 10-digit Indian mobile number, with a visible hint linked by aria-describedby.
  • type="date" with a min set by a short script to tomorrow, because a fixed date in the HTML would go stale.
  • minlength on the message, so "cake pls" is not enough.
  • autocomplete values so phones can fill name, phone and email.
  • :user-invalid in CSS, so red borders appear only after the user has touched a field.

The browser fires the submit event only when every field is valid. In the demo, the script stops the real submission and opens a <dialog> with a thank-you message. The dialog's Close button sits in a <form method="dialog">, so it closes without any script, and focus returns to the Send button.

HTMLOpen in editor
<!DOCTYPE html>
<html lang="en-IN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Contact us and order a cake | Gulabi Oven</title>
  <meta name="description" content="Address, phone and opening hours of Gulabi Oven in Malviya Nagar, Jaipur, with a form to order birthday and custom cakes a day ahead.">
  <link rel="canonical" href="https://gulabioven.example/contact.html">
  <link rel="icon" href="favicon.ico" sizes="32x32">
  <link rel="icon" href="icon.svg" type="image/svg+xml">
  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="manifest" href="site.webmanifest">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Gulabi Oven">
  <meta property="og:locale" content="en_IN">
  <meta property="og:title" content="Order a cake from Gulabi Oven">
  <meta property="og:description" content="Order birthday and custom cakes a day ahead. Pick up in Malviya Nagar, Jaipur.">
  <meta property="og:url" content="https://gulabioven.example/contact.html">
  <meta property="og:image" content="https://gulabioven.example/images/share.jpg">
  <meta property="og:image:alt" content="A pink-iced cake on the counter of Gulabi Oven">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="stylesheet" href="css/style.css">
  <style>
    :root { --rose: #a3245c; --ink: #222; --cream: #fff8f3; }
    * { box-sizing: border-box; }
    body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.5; }
    .skip { position: absolute; left: 8px; top: -60px; background: #111; color: #fff; padding: 8px 12px; }
    .skip:focus { top: 8px; }
    .site-header, main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 1rem; }
    .site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
    .site-header ul, .site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
    nav a { color: var(--rose); }
    nav a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--rose); }
    img { max-width: 100%; height: auto; }
    :focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
    .site-footer { border-top: 1px solid #e5d3c8; font-size: 0.9rem; }
    form p { display: grid; gap: 4px; max-width: 26rem; }
    input, select, textarea { font: inherit; padding: 6px; border: 2px solid #bbb; border-radius: 4px; }
    :user-invalid { border-color: #b3261e; }
    .hint { font-size: 0.85rem; color: #555; }
    dialog { border: none; border-radius: 10px; padding: 20px; max-width: 24rem; }
    dialog::backdrop { background: rgb(0 0 0 / 0.5); }
  </style>
</head>
<body>
  <a class="skip" href="#main">Skip to main content</a>
  <header class="site-header">
    <a href="index.html"><img src="https://course.ethicscomputer.in/assets/samples/logo.svg" alt="Gulabi Oven home" width="240" height="80"></a>
    <nav aria-label="Main">
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="services.html">Menu</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html" aria-current="page">Contact</a></li>
      </ul>
    </nav>
  </header>

  <main id="main" tabindex="-1">
    <h1>Contact us and order a cake</h1>
    <section aria-labelledby="find-us">
      <h2 id="find-us">Find us</h2>
      <p>Shop 4, Sector 7, Malviya Nagar, Jaipur 302017. Phone <a href="tel:+919000000000">+91 90000 00000</a>.</p>
      <p>Open 8 am to 9 pm, Monday to Saturday; 9 am to 2 pm on Sunday.</p>
    </section>

    <section aria-labelledby="order">
      <h2 id="order">Order a cake</h2>
      <form id="order-form" action="/order" method="post">
        <p>
          <label for="name">Your name</label>
          <input id="name" name="name" required autocomplete="name">
        </p>
        <p>
          <label for="phone">Mobile number</label>
          <input id="phone" name="phone" type="tel" required pattern="[6-9][0-9]{9}"
                 autocomplete="tel-national" aria-describedby="phone-hint">
          <span id="phone-hint" class="hint">10 digits, without +91 or 0</span>
        </p>
        <p>
          <label for="cake">Cake</label>
          <select id="cake" name="cake" required>
            <option value="">Choose a cake</option>
            <option>Pineapple, 500 g</option>
            <option>Chocolate truffle, 500 g</option>
            <option>Rasmalai fusion, 1 kg</option>
          </select>
        </p>
        <p>
          <label for="pickup">Pick-up date</label>
          <input id="pickup" name="pickup" type="date" required>
        </p>
        <p>
          <label for="message">Message on the cake and other details</label>
          <textarea id="message" name="message" rows="3" required minlength="10" maxlength="300"></textarea>
        </p>
        <p><button>Send order request</button></p>
      </form>
    </section>

    <dialog id="thanks" aria-labelledby="thanks-title">
      <h2 id="thanks-title">Order request received</h2>
      <p>Thank you, <span id="thanks-name"></span>. We will call you to confirm the order and the price.</p>
      <form method="dialog"><button autofocus>Close</button></form>
    </dialog>
  </main>

  <footer class="site-footer">
    <address>
      Gulabi Oven, Shop 4, Sector 7, Malviya Nagar, Jaipur 302017<br>
      Phone: <a href="tel:+919000000000">+91 90000 00000</a>
    </address>
    <nav aria-label="Footer">
      <ul>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
    <p>&copy; 2026 Gulabi Oven</p>
  </footer>

  <script>
    // Earliest pick-up date: tomorrow, written as YYYY-MM-DD
    const t = new Date();
    t.setDate(t.getDate() + 1);
    const pad = (n) => String(n).padStart(2, "0");
    document.querySelector("#pickup").min = `${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())}`;

    const form = document.querySelector("#order-form");
    const thanks = document.querySelector("#thanks");
    form.addEventListener("submit", (event) => {
      event.preventDefault(); // demo only: the real site lets the form post to /order
      document.querySelector("#thanks-name").textContent = document.querySelector("#name").value;
      form.reset();
      thanks.showModal();
    });
  </script>
</body>
</html>

Press Send with the form empty: the browser stops you at the first empty field. Type a phone number starting with 5 and its border turns red after you leave the field. Pick today's date and the browser refuses it. Fill everything correctly and the dialog opens with your name. Press Esc or Close and focus goes back to the button.

Step 6: Keep the shared parts in sync

You now have the same header and footer copied into four files. That is fine for four pages, but it has a cost: change the phone number and you must edit five places in four files. Miss one and the footer, the contact page and the JSON-LD disagree, which confuses both visitors and search engines.

Two habits keep a small static site honest:

  1. Change the shell in one file, then copy it. Edit the header in index.html first, then paste the same block into the other pages, changing only aria-current.
  2. Search the folder before you publish. In VS Code, press Ctrl+Shift+F and search for the old phone number or the old price. Zero results means you updated every copy.

On bigger sites, a server language includes one header file into every page, so the copies cannot drift. You will build exactly that in Scalable Website Structure.

Step 7: The launch checklist

A business site is finished when it passes these checks on every page, not when it looks right on your laptop.

  1. Validate. Upload or paste each page into the W3C Nu HTML Checker at validator.w3.org/nu and fix every error, as in HTML Validation Using W3C.
  2. Check the heads. Every page has a different title and description, and its canonical URL and og:url match its own address.
  3. Keyboard test. Unplug the mouse. On each page, Tab once to see the skip link, use it, and reach every link, field and button. Focus must always be visible. Open and close the dialog with the keyboard only.
  4. Landmarks. Open the accessibility tree in DevTools and confirm one banner, one main, two labelled navigation landmarks and one contentinfo per page, as in HTML Document Outline & Landmarks.
  5. Phone widths. Use the device toolbar at 360 pixels wide. Nothing should scroll sideways, and the about page should show the tall photo.
  6. Lighthouse. In Chrome DevTools, run Lighthouse on each page for Accessibility, Best Practices and SEO, and read every failed audit. A score is a hint, not a certificate: it cannot judge whether your alt text is accurate.
  7. Structured data and previews. Paste the home page into the Schema Markup Validator, and test one link in each platform's sharing debugger from the Open Graph lesson.
  8. Links. Click every menu and footer link on every page. A broken link on a four-page site is very visible.

Common mistakes

  • The same <title> on every page. Search results and browser tabs then show four identical entries. Plan the per-page table in Step 1.
  • aria-current="page" left on Home on every page. It happens when the header is copied without editing. Check it in each file.
  • JSON-LD that disagrees with the page. If the footer says 9 pm and the JSON-LD says 8 pm, fix both from one source of truth.
  • Relative og:image URLs. images/share.jpg works for the page but not for a WhatsApp preview. Use the full https:// address.
  • Lazy loading the hero image. It delays the most important picture on the page. Lazy load only images further down.

Interview questions

1. How do you show the current page in a navigation menu accessibly?

Add aria-current="page" to the link for the current page, and style it with the selector a[aria-current="page"]. Screen readers announce it as the current page, and the visual style comes from the same attribute, so the two cannot get out of sync.

2. Why does each page need its own title, description and canonical URL?

Search engines treat each URL as a separate page and show its title and description in results. Duplicate titles make pages look interchangeable, and a wrong canonical can tell a search engine to ignore the page. Each page should describe itself and point its canonical at its own address.

3. What does LocalBusiness JSON-LD do, and what is the main rule for it?

It describes the business's name, address, phone and opening hours in a format search engines can read without guessing, which can make the page eligible for richer results. The main rule is that it must match what the page visibly shows. It is not a guarantee of any special display.

4. Is built-in form validation enough for an order form?

No. It improves the experience for real users, but it runs in the browser, which the user controls. The server that receives the form must validate every field again.

5. Why use <picture> instead of only srcset on the about page?

srcset with sizes gives the browser the same picture at different sizes and lets it choose. <picture> with media forces a different image, such as a tall crop for phones. That is art direction, and it is a design decision the browser should not make by itself.

Key points

  • Plan the per-page values (title, description, canonical, current link) in a table before writing the pages.
  • Every page shares one shell: skip link, header with a labelled main <nav>, <main> and footer.
  • Mark the current menu link with aria-current="page" and style it with the same attribute.
  • Use absolute URLs for canonical, og:url and og:image, and keep JSON-LD identical to the visible facts.
  • Use real elements for real jobs: a table for prices, <details name> for the FAQ, <dialog> for the confirmation.
  • Validate, keyboard test and run Lighthouse on every page before launch, and validate forms again on the server.

Exercise

Add a fifth page, workshops.html, for weekend baking classes for children aged 8 to 14. It must use the same shell as the other pages, with aria-current="page" on a new "Workshops" link that you also add to the menu of the other four pages. Give it its own title, description, canonical URL and Open Graph tags. Add a short FAQ with two <details name="workshop-faq"> items and a booking form with the parent's name, a mobile number with the same pattern as the contact page, and the child's age as a number field from 8 to 14.

Show solution
HTML
<!DOCTYPE html>
<html lang="en-IN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Weekend baking workshops for children | Gulabi Oven</title>
  <meta name="description" content="Saturday baking classes for children aged 8 to 14 at Gulabi Oven, Malviya Nagar, Jaipur. Small groups, all ingredients included.">
  <link rel="canonical" href="https://gulabioven.example/workshops.html">
  <link rel="icon" href="favicon.ico" sizes="32x32">
  <link rel="icon" href="icon.svg" type="image/svg+xml">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Gulabi Oven">
  <meta property="og:title" content="Weekend baking workshops for children">
  <meta property="og:url" content="https://gulabioven.example/workshops.html">
  <meta property="og:image" content="https://gulabioven.example/images/share.jpg">
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <a class="skip" href="#main">Skip to main content</a>
  <header class="site-header">
    <a href="index.html"><img src="images/logo.svg" alt="Gulabi Oven home" width="240" height="80"></a>
    <nav aria-label="Main">
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="services.html">Menu</a></li>
        <li><a href="workshops.html" aria-current="page">Workshops</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>
  <main id="main" tabindex="-1">
    <h1>Weekend baking workshops for children</h1>
    <section aria-labelledby="ws-faq">
      <h2 id="ws-faq">Questions parents ask</h2>
      <details name="workshop-faq">
        <summary>Do parents need to stay?</summary>
        <p>No. Pick your child up after two hours.</p>
      </details>
      <details name="workshop-faq">
        <summary>Is the food eggless?</summary>
        <p>Yes, every workshop recipe is eggless.</p>
      </details>
    </section>
    <section aria-labelledby="book">
      <h2 id="book">Book a seat</h2>
      <form action="/workshop-booking" method="post">
        <p><label for="parent">Parent's name</label>
          <input id="parent" name="parent" required autocomplete="name"></p>
        <p><label for="mobile">Mobile number</label>
          <input id="mobile" name="mobile" type="tel" required pattern="[6-9][0-9]{9}" autocomplete="tel-national"></p>
        <p><label for="age">Child's age</label>
          <input id="age" name="age" type="number" required min="8" max="14"></p>
        <p><button>Book</button></p>
      </form>
    </section>
  </main>
  <footer class="site-footer">
    <!-- same footer as the other pages -->
  </footer>
</body>
</html>

The shell is unchanged apart from the new menu item and the aria-current position. Remember to add <li><a href="workshops.html">Workshops</a></li> to the menu in the other four files, then search the folder to confirm all five menus match.

Quick Quiz

1. On the contact page, which link should carry aria-current="page"?

2. Why must og:image be an absolute URL?

3. The footer says the shop closes at 9 pm but the JSON-LD says 8 pm. What should you do?

4. When does the contact form's submit event fire?

Learn HTML with a mentor

Free lessons get you started. Our Full Stack Web Development training adds real projects and code reviews from working developers.

  • Project-based learning
  • Mentor code reviews
  • Free counselling call