header
Introductory content for a page or section.
Learn header, nav, main, footer as part of the HTML element system: when to use it, how it fits inside a document and what mistakes to avoid.
Landmarks
Landmark elements such as header, nav, main and footer describe major areas of a page. They are not only layout wrappers; they tell browsers and assistive technology what each region does.
When landmarks are used well, a visitor can jump straight to navigation, main content or footer information without hunting through the page.
header, nav, main, footer. Large page regions that make a layout easier to understand. Syntax in context
Most pages need a header, nav, main and footer. Complex pages can also use aside or section where the content needs it.
<header> <a href="/">Full Stack Masterclass</a> </header> <nav aria-label="Main navigation"> <a href="/html">HTML</a> <a href="/css">CSS</a> </nav> <main> <h1>HTML Landmarks</h1> <p>Landmarks make the page easier to navigate.</p> </main> <footer>Contact and legal links</footer>
Good versus weak
<header> <a href="/">Full Stack Masterclass</a> </header> <nav aria-label="Main navigation"> <a href="/html">HTML</a> <a href="/css">CSS</a> </nav> <main> <h1>HTML Landmarks</h1> <p>Landmarks make the page easier to navigate.</p> </main> <footer>Contact and legal links</footer>
<div class="top"></div> <div class="menu"></div> <div class="content"></div> <div class="bottom"></div>
Rules that matter
If there are multiple nav elements, give them clear aria-label values.
Use one main element for the unique content of the page.
A section can also have its own header when it introduces that section.
A footer can close a section or the whole page.
Production thinking
Beginners often ask why this is not just a div with styling. The reason is that HTML is read by browsers, search engines, screen readers and future developers. Clear meaning makes the page easier to use and maintain.
Landmarks create shortcuts for assistive technology. That makes a long page much easier to use.
Good landmarks make templates readable and reduce the temptation to build everything from generic divs.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.