⬅ Back

HTML Structural Markup

Structural markup is the foundation of every web page. It defines how content is organized and helps both users and machines understand the page.

What is structural markup?

Structural markup is the way we organize content on a web page using HTML elements. It creates a clear layout and logical order of information.

A properly structured page is easier to read, easier to navigate, better for accessibility, and better for search engines (SEO).

Without structure, a page would be just one long block of text. With structure, content is divided into meaningful parts.

Main parts of a web page

Header (<header>)

The header is the top part of the page. It introduces the website or a section.

A page can have multiple header elements, but usually only one main header.

Main (<main>)

The main element contains the primary content of the page.

Footer (<footer>)

The footer is the bottom part of the page or section.

Logo in the header

The logo represents the brand and is placed in the header.

Navigation (<nav>)

Navigation helps users move around the website.

The <nav> tag is used only for the main navigation.

Anchor links

Anchor links allow navigation within the same page.

  1. Add a unique id to an element
  2. Use a link with href="#id"

Example: href="#about" scrolls to id="about".

Each id must be unique.

Sections (<section>)

Sections group related content into logical blocks.

Benefits:

The section tag can be used multiple times and is less specific than header or footer.

Links vs Buttons

Use <a> (link) when:

Link = navigation

Use <button> when:

Button = action

Rule: if it changes the URL → use link. If it changes behavior → use button.

HTML entities

Some characters cannot be typed directly or have special meaning in HTML.

Formats:

Examples:

Symbols like < and > must be written as entities to display them as text.

⬅ Back