Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

React
  • One Request, Two Answers: the Same Post as an HTML Page and as JSON
  • A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
  • How a Web Page Works: HTML Tags, Elements and Attributes
  • Semantic HTML: header, nav, main, aside and footer as Page Landmarks
  • HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)
  • CSS Basics: Selectors, Which Rule Wins, and the Box Model
  • CSS Flexbox vs Grid: A Nav Bar, a Card Row and a Dashboard
  • Responsive CSS: Viewport, Mobile-First Media Queries, clamp() and Dark Mode with Tokens
  • JavaScript for People Who Already Code: Syntax, Modules and Five Surprises
  • JavaScript Arrays the Functional Way: map, filter, reduce, find, sort and Object.entries
  • Async JavaScript: Promises, async/await, fetch and Promise.all
  • JavaScript in the Page: the DOM, querySelector and Events
  • npm, package.json and Vite: What npm install Fetches and How Vite Serves and Builds Your Page
  • TypeScript Essentials: Types Checked, Then Erased (Interfaces, Unions, Generics)
  • Why React, JSX and Components: The Page as a Function of Data
  • React Props and Composition: Data Down, Calls Up, Children in the Slot
  • Routing With React Router: One Page, Many Addresses
  • React Component Tests With Vitest and Testing Library: Test What the User Sees
  • End-to-End Tests for a React App With Playwright: A Full Dress Rehearsal
  • Why AI-Built Websites All Look the Same, and Four Levels That Fix It
  • Visual Hierarchy, Spacing and the 8-Point Grid: Tell the Eye What to Read First
  • Colour, Contrast and Dark Palettes: 60-30-10, Semantic Tokens and Ratios You Can Compute
  • Typography That Sells: Type Scale, Line Length and Free Font Pairings
  • The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
  • Design Tokens: Primitive and Semantic Tokens, from Figma to CSS to Tailwind
  • Tailwind CSS 4 in React: Utility Classes, Responsive Prefixes, Hover and Dark Mode
  • shadcn/ui in React: Components You Own, Edit and Commit
  • Design Tokens to a Tailwind Theme: Light and Dark Mode with @theme inline
  • Motion in React: Entrance, Hover, Exit and Layout Animations
  • A React Dashboard: Stat Cards, a Recharts Line Chart and a Sortable Table
  • Accessibility in Practice: Dialogs, Menus and the Keyboard in React
  • Reference-Driven Design: Extract a DESIGN.md From a Site You Admire and Build From It
  • Components, Variants and Variables: One Design System in Figma and in CSS
  • Figma MCP Server: Build a React Component From a Frame, Then Write It Back
  • Claude Design: From a Brief to a Clickable Prototype, Then Hand It Off to Claude Code
  • Critiquing AI-Generated UI: Six Checks for Every Screen
  • The AI Design Landscape: Prompt to UI, Prompt to App, and Design to Code
  • Your Brand Rules Folder: One Folder Every AI-Built Page Follows
  • The Best-Practice UI Prompt: Plain Sentences That Beat the Average AI Page
  • UI Ideas From Figma Make, Google Stitch and ChatGPT: One Prompt, Three Designs
  • Google Stitch From a Sketch or Screenshot: Show the Layout, Say What to Keep
  • Stitch to Figma to Code: Turn a Stitch Screen Into Code That Uses Your Tokens
  • Figma Make: Prompt to Prototype With a Four-Part Prompt
  • Upgrade a Dated UI From One Screenshot (or a Reference Image)
  • States and Feedback: Make Every Click Get an Answer
  • A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI
  • Copy Without the AI Tells: A Copy Pass on a Landing Page
  • React State, Events, Lists and Conditional Rendering: Follow One Click
  • React useEffect: When It Runs, What Cleanup Is For, and When You Don't Need One
  • Lifting State Up, Refs and React DevTools: Put State Where It Is Needed
  • Forms and Actions in React 19: Controlled Inputs, Form Actions, useActionState and useFormStatus
  • React Context and Custom Hooks: Share One Value, Reuse the Logic
  • Server State With TanStack Query: One Key, One Request, One Cache
  • Mutations and Optimistic Updates in TanStack Query: Change Data, Then Tell the Cache
  • Generate TypeScript Types, Query Hooks and Zod From an OpenAPI Spec With Orval
  • A Mock Backend in the Browser With Mock Service Worker, Generated From the Spec
  • A React Client for a FastAPI API: The CORS Wall, CORSMiddleware and the Vite Proxy
  • Forms With React Hook Form and Zod: The API's Rules in the Browser, the Server's Errors Under the Field
  • JWT Auth in a React Client With a FastAPI Backend: Log In, Carry the Token, Let the Server Decide
  1. Blog
  2. /
  3. React
  4. /
  5. Fundamentals

Semantic HTML: header, nav, main, aside and footer as Page Landmarks

The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Fundamentals

What you will learn

  • Replace div soup with header, nav, main, article, aside and footer
  • Read the landmarks a browser builds from semantic tags
  • Use a table only for real rows and columns, and div or span when no tag fits
  • Keep one main element per page

Before you start

  • HTML tags, elements and attributes

Nobody has to teach you how to read a newspaper. The name is at the top, a contents bar runs under it, the big story sits in the middle, a sidebar holds the extras, and the small print is at the bottom.

HTML has a name for each of those parts. The top is header, the contents bar is nav, the big story is main with an article inside, the sidebar is aside and the small print is footer. These are semantic tags. Semantic just means "has a meaning": the tag tells the browser what the part is, not how it looks.

Div soup or semantic tags

Here's one small page written the "div soup" way. Every part is a div, and only a class name says what it is:

  <div class="header">
    <div class="title">Web Basics</div>
    <div class="nav">
      <a href="#">Lessons</a>
      <a href="#">Tasks</a>
      <a href="#">Sign up</a>
    </div>
  </div>
  <div class="main">
    <div class="article">
      <div class="lesson">Lesson 2: Page structure</div>
      <p>Every page has a top, a middle and a bottom.</p>
    </div>
    <div class="aside">Tip: one main part per page.</div>
  </div>
  <div class="footer">Made by Emma Clarke</div>

And the same page with semantic tags:

  <header>
    <h1>Web Basics</h1>
    <nav>
      <a href="#">Lessons</a>
      <a href="#">Tasks</a>
      <a href="#">Sign up</a>
    </nav>
  </header>
  <main>
    <article>
      <h2>Lesson 2: Page structure</h2>
      <p>Every page has a top, a middle and a bottom.</p>
    </article>
    <aside>Tip: one main part per page.</aside>
  </main>
  <footer>Made by Emma Clarke</footer>

Open both in a browser and every word sits in the same spot, same size, same colour. The difference is underneath. The browser can't read class names like "header"; it can read the header tag.

Look at the semantic version from the top. The header holds the h1, Web Basics, and a nav with three links. main is the part only this page has. Inside it, the article is one complete story and the aside is a side note, our tip. The footer carries the small print.

Same styles, fewer names to invent

The CSS shows the second win. In the div soup version every rule needs a class:

.header { background: #1E3A8A; color: white; padding: 10px 20px; }
.title { font-size: 24px; font-weight: bold; margin-bottom: 4px; }
.nav a { color: #BFDBFE; margin-right: 16px; }

With semantic tags, the tag name is already there, so the selector is just the tag:

header { background: #1E3A8A; color: white; padding: 10px 20px; }
h1 { font-size: 24px; margin: 0 0 4px; }
nav a { color: #BFDBFE; margin-right: 16px; }

Same colours, same spacing, and the page needs no invented class names for its parts.

The tags become landmarks

Open Chrome DevTools and look at the accessibility tree for the semantic page. Five rows stand out:

Each semantic tag maps to a landmark: header to banner, nav to navigation, main to main, aside to complementary, footer to contentinfo. Div soup produces none. tag in your HTML landmark in the accessibility tree headernavmainasidefooter bannernavigationmaincomplementarycontentinfo div soup: 0 landmarks
Header becomes banner, nav becomes navigation, aside becomes complementary and footer becomes contentinfo. The div soup page gives none of these.

These are called landmarks. The two headings also keep their levels, h1 at level one and h2 at level two, which gives the page an outline. This tree is what screen readers read out and what search engines get.

Same look, three differences

  1. Screen readers can jump. A blind user hears a list of landmarks and jumps straight to one. The div soup page gives them nothing to jump to; the semantic page gives five.
  2. Search engines read the outline. The div soup page has no headings at all. The semantic page says h1, Web Basics, then h2, Lesson 2.
  3. Simpler CSS. .header becomes header.

Using the tag that says what the part is costs nothing, and everyone reading the page benefits.

A table for real data

A lesson timetable is real rows and columns, so it gets a table:

    <table>
      <tr>
        <th>Day</th>
        <th>Lesson</th>
        <th>Teacher</th>
      </tr>
      <tr>
        <td>Monday</td>
        <td>Page structure</td>
        <td>Emma Clarke</td>
      </tr>
      <tr>
        <td>Thursday</td>
        <td>Forms</td>
        <td>Jack Miller</td>
      </tr>
    </table>
    <!-- no tag fits? div is a plain box, span a plain piece of text -->
    <div class="note">
      Bring a laptop to <span class="room">Lab 3</span>.
    </div>

Every tr is one row. th is a header cell, so the first row names the columns: Day, Lesson and Teacher. td is one cell of data, one row per lesson. Use a table only for real tabular data, never to lay out a page.

At the bottom are div and span. These two have no meaning at all. A div is a plain box and a span is a plain piece of text. Reach for them only when no other tag fits, for example to give "Lab 3" its own style.

Break it: two main parts

Change <aside> and </aside> to <main> and </main>. The page looks almost the same and opens without any error or warning. But the accessibility tree now shows a main with a second main inside it, and a screen reader finds two main parts. Keep it to one main per page, always.

A second break to try in the timetable: delete the first tr with the th cells. The data is still there, but nothing says which column is Day, Lesson or Teacher.

Quick recap

TagPart of the pageLandmark
headertop: title and usually the navbanner
navlinks around the sitenavigation
mainwhat only this page has (one per page)main
articleone complete story-
asidea side notecomplementary
footerthe small printcontentinfo
table, tr, th, tdreal rows and columns of data-
div, spanno meaning; use when nothing else fits-

Try it yourself

Take the About me page from HTML tags, elements and attributes and give it a header with a nav, a main with an article, an aside and a footer. Then open DevTools, find the accessibility tree and check that all five landmarks are there.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in React · 4 of 59

Previous
How a Web Page Works: HTML Tags, Elements and Attributes
Next post
HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Related posts

One Request, Two Answers: the Same Post as an HTML Page and as JSON

Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.

A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx

Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.

How a Web Page Works: HTML Tags, Elements and Attributes

A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.

HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)

Follow a sign-up form's answers out of the page: label and id, name as the key, browser validation, the query string a GET form builds, and why POST hides it. Plus the most common bug, an input with no name.

On this page

  • Div soup or semantic tags
  • Same styles, fewer names to invent
  • The tags become landmarks
  • Same look, three differences
  • A table for real data
  • Break it: two main parts
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.