Chapters
Narrated with a synthetic Indian English voice from a script written by the instructor. Code, browser and terminal output come from the tested lesson files.
In this lesson you will
- Write the boilerplate every HTML document needs
- Use headings, paragraphs, lists, links and images
- Group content with header, nav, main, section and footer
- Write a title and meta description
HTML (HyperText Markup Language) describes what each piece of a page is: this is a heading, this is a list, this is a link. It doesn't decide how things look; that's CSS's job in the next module. In this lesson you'll build the page for Sunrise Bakery, a small example business we'll keep improving for the rest of the course.
Set up the project
- 1Create a folderMake a folder called sunrise-bakery and open it in VS Code with File > Open Folder.
- 2Create index.htmlAdd a new file named index.html. Browsers and web servers treat index.html as the default page of a folder.
- 3Add the logoDownload logo.svg from this lesson's files and save it in the same folder.
The complete page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sunrise Bakery | Fresh bread every morning</title>
<meta name="description" content="Sunrise Bakery bakes bread, buns and cakes fresh every morning. See today's menu, opening hours and how to find us.">
</head>
<body>
<header>
<img src="logo.svg" alt="Sunrise Bakery logo" width="64" height="64">
<h1>Sunrise Bakery</h1>
<p>Fresh bread, every morning.</p>
<nav>
<a href="#menu">Menu</a>
<a href="#hours">Hours</a>
<a href="#contact">Contact</a>
</nav>
</header>
<main>
<section id="about">
<h2>About us</h2>
<p>We start baking at 5 a.m. so the bread on our shelves is never more than a few hours old.</p>
</section>
<section id="menu">
<h2>Today's menu</h2>
<ul>
<li><strong>Sourdough loaf</strong> — slow-fermented for 24 hours</li>
<li><strong>Butter buns</strong> — soft, golden, sold in sixes</li>
<li><strong>Carrot cake</strong> — by the slice or whole</li>
</ul>
</section>
<section id="hours">
<h2>Opening hours</h2>
<p>Monday to Saturday, 7 a.m. to 8 p.m. Closed on Sundays.</p>
</section>
<section id="contact">
<h2>Contact</h2>
<p>Call us on <a href="tel:+910000000000">+91 00000 00000</a> or <a href="mailto:hello@example.com">email us</a>.</p>
</section>
</main>
<footer>
<p>© 2026 Sunrise Bakery</p>
</footer>
</body>
</html>What each part does
- <!DOCTYPE html>
- Tells the browser this is a modern HTML document. Without it, browsers fall back to an old compatibility mode.
- <html lang="en">
- The root element. lang tells screen readers and search engines the page language.
- <meta charset="UTF-8">
- The text encoding, so characters like ₹, é and — display correctly.
- <meta name="viewport">
- Makes phones show the page at their real width instead of a zoomed-out desktop view.
- <title>
- The text in the browser tab, and usually the blue headline in search results.
- <meta name="description">
- A summary that search engines may show under the title.
- <header>, <nav>, <main>, <footer>
- Landmark elements that say what each region is. Screen-reader users can jump between them.
- <h1> to <h6>
- Headings in order of importance. Use one <h1> per page for its main topic, then <h2> for sections.
- <img src alt width height>
- An image. alt describes it for people who can't see it; width and height let the browser reserve space before it loads.
- <a href>
- A link. #menu jumps to the element with id="menu"; tel: and mailto: open the phone dialler or email app.
Open it in the browser
Double-click index.html, or drag it into Chrome. You'll see plain black text on white, with blue links. That is the browser's default styling, and it's exactly what you should see at this stage. Click Menu in the navigation and the page jumps to that section.
Check your work
- Right-click the page and choose View Page Source: it should match your file exactly.
- Press F12 and open the Console tab. There should be no red errors.
- Rename logo.svg for a moment and reload. The alt text appears in place of the image; that's what alt is for. Rename it back.
Make it yours
- Add a fourth item to the menu list.
- Add a new section with id="reviews" and a link to it in the nav.
- Change the title and meta description to describe a business you know.
