Semantic elements like <nav>, <main>, and <header> give screen readers clues about the page structure. This helps users navigate and understand the content better.
The <main> element is used to wrap the main content of a page. Screen readers can jump directly to this section, improving navigation.
<nav> element?<nav aria-label="Primary navigation"> <ul> <li><a href="#home">Home</a></li> <li><a href="#about">About</a></li> </ul> </nav>
The <nav> element is a landmark region. The aria-label gives it a name. Screen readers announce both the landmark type and label, plus the list details.
The :focus pseudo-class targets elements when they receive keyboard focus. This helps keyboard users see which element is active.
<main> elements?<main> element should be unique per page for clear navigation.Using multiple <main> elements creates multiple main landmarks. Screen readers announce each, which can confuse users about the page's primary content.
