HTML Semantic Elements
In the previous lesson, we learned about HTML lists. Now, let's learn about HTML semantic elements and how to use them to improve the structure and accessibility of your web pages.
Semantic elements clearly describe their meaning in a human- and machine-readable way. They help improve the accessibility and SEO of your web pages.
Here are some common semantic elements that you will use frequently:
Let's see how to use some of these semantic elements in an HTML document:
<header>
<h1>Welcome to My Website</h1>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section>
<h2>About Me</h2>
<p>This is the about section.</p>
</section>
<article>
<h2>My Article</h2>
<p>This is an article.</p>
</article>
<aside>
<h2>Related Links</h2>
<p>This is an aside section.</p>
</aside>
</main>
<footer>
<p>Footer content goes here.</p>
</footer>