JomMula

Frontend Development: HTML to React · HTML · Lesson 03

Semantic structure: build the skeleton

A page isn't just a pile of divs. Learn the tags that describe the parts of a page — header, nav, main, section, footer — and why they make everything easier.

6 min readHTMLstructureaccessibilityUpdated October 2026

In lesson 2 we learned the tags that hold content. Now we need tags that describe the shape of a page.

This is where a lot of beginners reach for <div> and never look back. A <div> is a generic box — useful, but it says nothing about what’s inside. Semantic tags say something.

The page skeleton

Every HTML page has the same basic shape:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Calorie Calculator</title>
  </head>
  <body>
    <!-- the page goes here -->
  </body>
</html>
  • <!doctype html> tells the browser this is modern HTML.
  • <html lang="en"> says the page is in English. Screen readers use this.
  • <head> holds information about the page: title, character set, viewport, and links to CSS.
  • <body> holds everything people actually see.
  • The <title> is the text in the browser tab, not on the page.

The semantic tags

These are the ones you’ll use most:

Tag What it means
<header> The top of a page or section — title, logo, intro
<nav> A group of major navigation links
<main> The main content of the page. One per page.
<section> A thematic group of content, usually with a heading
<article> A self-contained piece of content (a post, a card)
<aside> Content related to the main thing, but not part of it
<footer> The bottom of a page or section

You can still use <div> for a box that’s purely for layout. The rule isn’t “never use div.” It’s “use the tag that describes the content, and use div when nothing does.”

The calculator skeleton

Here’s the structure we’ll use for our app. It has no real content yet — just the boxes:

Preview

Edit the code, then hit Run (or Ctrl + Enter) and watch the preview. This is a safe sandbox — you can't break the page.

Notice how the page reads like an outline even before you style it. That’s the point.

Why semantics matter

  • Accessibility. Screen readers use landmarks like <main> and <nav> to jump around the page. A page made of divs is a maze.
  • Readability. Six months from now, <header> and <footer> tell you what a section is. <div class="top-thing"> doesn’t.
  • SEO. Search engines use headings and structure to understand the page.
  • Consistency. You and every other developer already know what these tags mean.

Build the skeleton

the plan's verify step

Open your index.html from lesson 1. Replace the body with the calculator skeleton: a header, a nav, a main with two sections, and a footer. Don't add form fields yet — just the structure and headings.

Check your headings: one h1, then h2s for each section. No skipping levels just because you like the size.

The mistakes everyone makes

  • Using <div> for every section. Try <section>, <header>, <footer> first.
  • Using <section> without a heading. A section is a thematic group; give it an <h2>.
  • Multiple <main> elements. One per page.
  • A <nav> around every link. <nav> is for major navigation, not a single “read more” link.
  • Styling before structure. If the outline doesn’t make sense, no amount of CSS will fix it.

The document skeleton: doctype, html, head, body.

head holds metadata; body holds what people see.

Semantic tags describe the role of a section: header, nav, main, section, footer.

One main per page; sections get headings.

div is still useful — just don't use it when a better tag exists.

Next: forms and inputs. This is where the calculator starts to become something you can actually interact with.

Previous: Text, links, images, and lists
04

Up next

Forms and inputs: the calculator's controls

Forms are how the web collects information. Learn labels, input types, selects, radio buttons, and the attributes that make a form usable — then build the calculator's controls.

Read now