Understand the benefits of using Semantic HTML
Semantic HTML involves choosing elements that convey the meaning of the content rather than just its appearance. This provides four primary advantages:
- Accessibility: Screen readers use semantic landmarks (like
<nav>) to help users navigate sites efficiently. - SEO: Search engines use elements like
<main>,<article>, and<section>to understand content hierarchy and primary purpose. - Code Readability: Semantic tags are self-documenting, making the structure clear without relying on class names.
- Browser Support: Elements like
<button>have built-in keyboard navigation and ARIA roles that generic<div>elements lack.