HTML Layout and Structure

In modern HTML, semantic elements like <header>, <main>, and <footer> are used to define the structure and layout of a webpage.

<header> - The Introductory Section

The <header> element represents the introductory content for a webpage or a section.

It is typically placed at the top, but it can also appear inside other elements like <article> or <section>.

Purpose:

Example:

<header>
    <h1>Main Heading</h1>
</header>

Important Rules:

<main> - The Core Content Area

The <main> element represents the main content of the webpage. It defines the primary purpose of the page.

Purpose

Example:

<main>
    <h2>Learn HTML</h2>
    <p>This is the main content of the page.</p>
</main>

Important Rules:

<footer> - The Closing Section

The <footer> element represents the bottom section of a webpage and contains supporting information.

Purpose

<footer>
    <p>© 2026 Footer Section</p>
    <a href="https://www.codeeasyhub.com/introduction.html">Visit our HTML Tutorial</a>
</footer>

Important Rules:

Why Semantic Elements Are Important

Conclusion

<header>, <main>, and <footer> are essential semantic elements in HTML5 that define the structure and organization of a webpage.

They divide a webpage into clear sections—where <header> introduces the content, <main> contains the primary and most important information, and <footer> provides supporting or concluding details.