HTML Semantic Elements
Semantic elements clearly define the role of content on a web page, improving structure and accessibility. Examples include <header>, <footer>, <article>, and <section>.
Example:
<header>
<h1>Welcome to My Website</h1>
</header>
<section>
<article>
<h2>Article Title</h2>
<p>This is an article.</p>
</article>
</section>
<footer>
<p>© 2023 My Website</p>
</footer>
Benefits of Semantic Elements:
- Improved Accessibility: Helps screen readers understand the structure of the page.
- Better SEO: Search engines can better understand the content.
- Cleaner Code: Makes the code easier to read and maintain.
Next Steps
In the next tutorial, we will explore HTML Best Practices, where you will learn how to write clean, maintainable, and accessible HTML code.