WEMAXA.COM Design · Development · AI · Available worldwide
Studio / Wemaxa 01
Status Active Location Worldwide Focus Web + AI Delivery Remote Response < 1 Business Day
Tutorial 036Web Design & Development15 steps3 fixes

How to Structure a Web Page With Semantic HTML

A beginner guide to building a page with meaningful HTML elements instead of using generic divs for every part.

By the end: You will have a valid page skeleton with header/nav/main/sections/footer, a logical heading structure and native links/buttons/forms.

TARGET RESULTHow to Structure a Web Page With Semantic HTML

You will have a valid page skeleton with header/nav/main/sections/footer, a logical heading structure and native links/buttons/forms.

Key terms before you start

These definitions make the steps easier to follow and help distinguish controls, files and concepts that can look similar at first.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
HTML elementA structural part of a web document, e.g. <p>, <h2>, <a>, <button> or <nav>.
Semantic HTMLUsing HTML elements according to meaning/purpose rather than choosing generic elements for everything.
Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
CSSCascading Style Sheets; it controls presentation such as layout, spacing, color and responsive behavior.

What you need before starting

  • A code editor
  • A local/staging web page you are allowed to edit
  • A modern browser with Developer Tools
FULL TUTORIAL

Step-by-step tutorial

Every step is shown below. Work through them in order and use each checkpoint to confirm the result before moving on.

01
STEP 01 / 15

Work on a local or staging copy

Do this

Open the project containing the HTML/CSS source. If this is a production site, use a staging copy or backup before structural changes.

Why

A browser page is rendered from source files/CMS output; DevTools edits do not save back to the server.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
IF THIS GOES WRONGDevTools change disappears

Expected: DevTools edits are temporary. Copy the tested change into the real source/CMS and save it.

CHECKPOINTYou know which source file/template controls the page.
02
STEP 02 / 15

Open the page in a modern browser

Do this

Load the page, then press F12 or Ctrl+Shift+I (Windows/Linux) to open Developer Tools.

Why

DevTools lets you inspect the DOM, applied CSS, computed sizes, requests and console errors.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
IF THIS GOES WRONGA CSS rule does not apply

Inspect specificity/order/inheritance in DevTools before adding !important.

CHECKPOINTDevTools is open beside the page.
03
STEP 03 / 15

Create the document skeleton

Do this

Start with <!doctype html>, <html lang="en">, <head> and <body>.

Why

The doctype selects modern HTML parsing; lang helps assistive technology choose language rules.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
CHECKPOINTThe document has one html/head/body structure.
04
STEP 04 / 15

Add the site header

Do this

Inside <body>, add <header> for introductory/site-header content.

Why

Header does not automatically mean “top of screen”; it identifies introductory content for its context.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
IF THIS GOES WRONGThe page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

CHECKPOINTThe logo/title/navigation area is inside header.
05
STEP 05 / 15

Add primary navigation

Do this

Place major site links inside <nav aria-label="Primary">.

Why

Use <a href="..."> for navigation because links have destination semantics and browser behavior.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
CHECKPOINTTab reaches each navigation link.
06
STEP 06 / 15

Add one main landmark

Do this

Add a single <main> containing the page-specific content.

Why

Main should not contain repeated site-wide header/footer content.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
IF THIS GOES WRONGThe page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

CHECKPOINTDevTools shows one main element.
07
STEP 07 / 15

Write the page H1

Do this

Place an <h1> naming the page subject near the start of main.

Why

Heading levels describe hierarchy, not font size.

CHECKPOINTThe page subject is obvious with CSS disabled.
08
STEP 08 / 15

Create meaningful sections

Do this

Use <section> for thematic groups and give each important section a heading.

Why

A section with no thematic purpose may be better as a div/group.

Semantic HTMLUsing HTML elements according to meaning/purpose rather than choosing generic elements for everything.
IF THIS GOES WRONGA CSS rule does not apply

Inspect specificity/order/inheritance in DevTools before adding !important.

CHECKPOINTEach section can be named by its heading.
09
STEP 09 / 15

Use paragraphs and lists according to content

Do this

Put prose in <p>; use <ul>/<ol> when content is actually a list/sequence.

Why

Do not add <br> repeatedly to fake paragraph spacing.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
IF THIS GOES WRONGThe page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

CHECKPOINTContent retains meaning without CSS.
10
STEP 10 / 15

Use button versus link correctly

Do this

Use <button> for an action on the current interface; use <a href> to navigate to another URL/location.

Why

Styling can make them look similar without changing semantics.

CHECKPOINTControls behave correctly with keyboard/browser context menu.
11
STEP 11 / 15

Add the footer

Do this

Put repeated closing/site information in <footer>.

Why

A footer can contain legal/navigation/contact information and is separate from main page content.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
IF THIS GOES WRONGThe page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

CHECKPOINTFooter is outside main when it is site-wide.
12
STEP 12 / 15

Disable CSS mentally/temporarily

Do this

In DevTools disable the stylesheet or inspect the DOM order.

Why

Semantic structure should still read in a logical sequence.

CSSCascading Style Sheets; it controls presentation such as layout, spacing, color and responsive behavior.
IF THIS GOES WRONGA CSS rule does not apply

Inspect specificity/order/inheritance in DevTools before adding !important.

CHECKPOINTContent order remains understandable.
13
STEP 13 / 15

Check heading outline

Do this

Use DevTools accessibility tools/heading inspection or read the h1/h2/h3 order.

Why

Do not skip levels merely for appearance.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
IF THIS GOES WRONGA CSS rule does not apply

Inspect specificity/order/inheritance in DevTools before adding !important.

CHECKPOINTHeadings form a meaningful hierarchy.
14
STEP 14 / 15

Test the public/staging URL logged out

Do this

Open the final URL in a private/incognito window.

Why

CMS/admin sessions can hide caching, permission or styling differences.

IF THIS GOES WRONGThe page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

CHECKPOINTThe visitor view matches the intended result.
15
STEP 15 / 15

Document the changed file/rule

Do this

Record the file/template/component and purpose of the change in the project notes or version-control commit.

Why

Future maintainers should not have to reverse-engineer why a rule exists.

HTML elementA structural part of a web document, e.g. <p>, <h2>, <a>, <button> or <nav>.
IF THIS GOES WRONGDevTools change disappears

Expected: DevTools edits are temporary. Copy the tested change into the real source/CMS and save it.

CHECKPOINTThe change has a traceable reason/location.
CONCRETE EXAMPLERule

Test the rendered page, not only the source code.

Concrete examples

RuleTest the rendered page, not only the source code.

Copyable example

Semantic HTML example
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>Roof repair services</title>
</head>
<body>
  <header>
    <nav aria-label="Primary">
      <a href="/">Home</a>
      <a href="/services/">Services</a>
      <a href="/contact/">Contact</a>
    </nav>
  </header>

  <main>
    <h1>Roof repair services</h1>
    <section aria-labelledby="repairs">
      <h2 id="repairs">What we repair</h2>
      <p>Replace this with factual service information.</p>
    </section>
  </main>

  <footer>© Example business</footer>
</body>
</html>

Troubleshooting

DevTools change disappears

Expected: DevTools edits are temporary. Copy the tested change into the real source/CMS and save it.

The page overflows only with long content

Test realistic/long content and fix intrinsic sizing/wrapping rather than designing around short demo text.

A CSS rule does not apply

Inspect specificity/order/inheritance in DevTools before adding !important.

FINAL CHECKDocument the changed file/rule

The change has a traceable reason/location.

Documentation and references

Use these primary and supporting sources to verify current controls, browser behavior and product-specific details.