1. <header>
The <header> element represents introductory content or a set of navigational links. It usually contains the site logo, main heading, or menu.
Semantic tags clearly describe their meaning to both the browser and the developer. Unlike generic tags like <div> or <span>, semantic tags tell what kind of content they contain, which helps with SEO, accessibility, and maintainable code.
Using semantic tags improves:
The <header> element represents introductory content or a set of navigational links. It usually contains the site logo, main heading, or menu.
The <nav> element defines a section intended for navigation links like menus or tables of contents.
The <main> tag holds the dominant content of the document. There should only be one <main> per page.
The <section> element groups related content into thematic sections, usually with a heading.
The <article> tag contains independent content that could be distributed or reused elsewhere, such as blog posts, news articles, or comments.
The <aside> element holds content indirectly related to the main content — like sidebars, ads, or related links.
The <footer> element contains footer content for its nearest sectioning content or the entire page. It typically includes author info, copyright, or contact info.
Try the following exercises to deepen your understanding of semantic tags:
<header>, <nav>, <main>, and <footer> section. Put appropriate content inside each.<main>, add two <article> elements, each with a heading and some text.<section> to group related articles logically inside the main content.<aside> with additional info or links, positioned beside your main content using CSS.By practicing, you will make your pages more structured, accessible, and easier to maintain.