Semantic HTML: How to Structure Web Pages
- Sakmo Trainings
- May 30, 2024
- 2 min read
Updated: Jul 1, 2024

Semantic HTML is crucial for creating well-structured, accessible, and SEO-friendly web pages. It involves using HTML tags that convey the meaning and structure of the content, making it easier for browsers, search engines, and assistive technologies to understand and navigate the web page. Here’s a guide on how to structure web pages using semantic HTML.
1. Basic Structure of an HTML Document
A basic HTML document should start with a `<!DOCTYPE html>` declaration and be structured as follows:
2. Header (`<header>`)
The `<header>` element represents the introductory content or a set of navigational links for a section or page. It often contains the site's logo, the main navigation menu, and possibly a search form.
3. Navigation (`<nav>`)
The `<nav>` element is used to define a block of navigation links. It’s typically used for the primary site navigation.
4. Main Content (`<main>`)
The `<main>` element is used to enclose the dominant content of the `<body>` of a document. It should contain the primary content of your web page.
5. Sections (`<section>`)
The `<section>` element represents a thematic grouping of content, typically with a heading. It’s used to group related content together.
6. Articles (`<article>`)
The `<article>` element is used for self-contained content that can be independently distributed or reused, such as blog posts, news articles, or forum posts.
7. Asides (`<aside>`)
The `<aside>` element is used for content that is tangentially related to the content around it. It often appears as sidebars.
8. Footers (`<footer>`)
The `<footer>` element is used for the footer of a document or section. It typically contains information about the author, copyright information, or links to related documents.
9. Headings (`<h1>` to `<h6>`)
Headings (`<h1>` to `<h6>`) are used to define the hierarchy and structure of content. `<h1>` is used for the main title, while `<h2>` to `<h6>` are used for subheadings.
10. Other Semantic Elements
- `<figure>` and `<figcaption>`: Used to mark up diagrams, images, and illustrations, along with their captions.
- `<address>`: Provides contact information for the author or owner of the document.
- `<time>`: Represents a specific period in time.
Benefits of Using Semantic HTML
Improved Accessibility: Semantic elements provide better context for screen readers and assistive technologies, enhancing the accessibility of your web page.
Better SEO: Search engines can better understand the structure and content of your web page, leading to improved search rankings.
Easier Maintenance: Semantic HTML makes your code more readable and maintainable, making it easier for developers to understand and update the code.
Consistent Styling: Using semantic elements allows for more consistent styling across different pages and sections of your website.
By using semantic HTML, you create a clear, logical structure for your web pages, which benefits both users and search engines.
















Comments