Course outline

HTML & CSS / Foundations / Lesson 7

Landmarks and a keyboard skip link

Organize a page with native landmarks and provide a visible keyboard route past repeated navigation.

About 22 min read20 worked examples20 practice exercisesContent reviewed
On this page

Lesson goals

  • Identify main and navigation landmarks.
  • Connect a skip link to its destination.
  • Verify keyboard focus and visible styling.
  • Identify landmarks, skip destinations and intended focus order.
  • Design scoped checks for visibility, destination and onward navigation.

Organize the document

A page often repeats navigation before its main content. Native header, nav, and main elements communicate meaningful regions to browsers and assistive technologies. Use one main region for the page’s primary content and a clear heading within it. A skip link gives keyboard users a direct route past repeated navigation. Its target must exist and should lead to the beginning of the relevant content, not an unrelated decorative element.

Connect link and destination

The HTML places a skip link first, identifies the navigation, and gives main a matching id. tabindex="-1" allows the main element to receive programmatic focus without adding it to the normal sequential tab order. The link is a regular fragment link and works without script. The example links are illustrative paths; use real destinations in an application. Check browser behavior and focus at the target in the supported environment.

html Landmarks and destination
<a class="skip-link" href="#main-content">Skip to main content</a>
<header>
  <nav aria-label="Primary">
    <a href="/courses">Courses</a>
    <a href="/help">Help</a>
  </nav>
</header>
<main id="main-content" tabindex="-1">
  <h1>Course overview</h1>
  <p>Choose a lesson to begin.</p>
</main>

The fragment target connects the first link to the main content region.

Reveal the link on focus

The CSS moves the link out of view until it receives focus, then gives it a visible position, background, padding, and stacking order. Its text and background need sufficient contrast in the actual theme. Keep the link available to keyboard focus; hiding it with display:none would remove it from that interaction. Combine the HTML and CSS in a document with a viewport declaration when testing the example.

css Reveal the focused link
.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  inset-block-start: 0.5rem;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
  background: white;
  color: black;
  padding: 0.75rem;
  z-index: 10;
}

The link remains focusable while its focused state is brought into view.

Preserve structure and direction

Use navigation labels when multiple navigation regions need distinct names, and avoid adding redundant ARIA roles to native elements without a reason. Logical inset properties help the link follow writing direction, but test the actual Arabic and English layouts rather than assuming the same placement is always appropriate. Ensure the revealed link is not covered by a fixed header and that the destination heading remains visible.

Verify the interaction

Reload the page and press Tab from the browser’s starting focus. Confirm the skip link becomes visible, activate it, and check that focus and the viewport reach the main region. Continue tabbing to verify the next interactive control follows a sensible order. Test with keyboard, zoom, a narrow viewport, and an accessibility tree; a DOM inspection alone does not establish the complete user experience.

Map repeated and primary regions

A page can contain repeated site navigation before its unique primary content. Native header, nav and main elements express useful structural roles without requiring redundant ARIA roles. A main region should identify the principal content, with a meaningful heading and a logical source order. When a page has multiple navigation regions, concise names can distinguish site navigation from a table of contents; avoid creating landmarks for every decorative box because an overloaded region list can make orientation harder.

A skip link is one way to bypass repeated blocks: place a real anchor early in source order and point its fragment to an existing unique ID at the beginning of the intended content. A link to an unrelated decorative element or a missing ID does not satisfy that goal. The target and its surrounding heading should make sense after navigation. Native landmarks, headings and a skip link complement one another, but they do not replace a task-level keyboard and assistive-technology review.

Connect the fragment and focus deliberately

A fragment href such as #main-content refers to the corresponding element ID. Ensure the target exists exactly where the user should continue, and avoid duplicate IDs that make the relationship ambiguous. A regular anchor retains native navigation behavior without requiring a script. tabindex="-1" can make a target programmatically focusable without adding it to ordinary sequential Tab navigation; it does not by itself prove that every browser or assistive technology will move focus exactly as the design expects.

Test from a fresh page load in supported environments: reach the link, activate it, observe the viewport and focus location, then continue with Tab to the next relevant control. Browser fragment and focus behavior can vary with the target and environment, so record actual observations rather than assuming the presence of tabindex guarantees the entire workflow. If script is used to manage focus, ensure it supports the native link rather than making navigation depend on a fragile hidden interaction.

Keep focus reachable and perceivable

A skip link may be continuously visible or visually hidden until it receives focus. If hidden, the technique must leave it keyboard-focusable and reveal it when focused; display:none removes it from that interaction. The focused link needs readable text and contrast, a clear focus indication and sufficient stacking so it is not covered by a fixed header. A high z-index alone is not a universal guarantee across stacking contexts, so inspect the actual layout.

Use logical inset properties when they suit both left-to-right and right-to-left layouts, but test each intended direction, narrow width and zoom. The target heading can also be obscured by a fixed header after fragment navigation; adjust spacing or scrolling behavior deliberately and verify the resulting viewport. Avoid promising identical focus behavior from source inspection or a single screenshot. A visible focused control and a usable destination are separate acceptance checks.

Keep source and interaction order coherent

Source order should describe the reading and task sequence. A skip link placed after a long navigation block is less useful as a bypass, and positive tabindex values can create a focus sequence that competes with document order. Prefer an early link, ordinary sequential navigation and a target at the correct content boundary. Do not infer keyboard order from visual placement when CSS reorders elements; test Tab and Shift+Tab and compare the sequence with the user’s task.

Landmark navigation by assistive technology and sequential keyboard focus are related but distinct interaction modes. A main landmark can help a user navigate regions, while a skip link provides a direct keyboard route; one does not automatically establish the other’s focus result. Use unique, meaningful names for genuinely distinct navigation regions and review the heading at the destination. Test the supported combinations and document differences instead of adding unnecessary regions or positive tabindex values as a blanket repair.

Verify the complete bypass task

A focused test should include a fresh load, keyboard navigation to the skip link, visible focus, activation, target position and the next interactive control. Repeat at a narrow viewport, meaningful zoom and both intended writing directions where applicable. Check contrast and that neither the link nor target is covered. Inspect the DOM and accessibility tree as supporting evidence, but neither alone proves the complete interaction for all users.

Record the exact fixture, browser and version, operating environment, viewport, zoom, input method, assistive technology and observed result for any actual run. A validator can catch some structural issues but cannot establish that a link is visible on focus or reaches the intended task in every environment. The cases below are synthetic unexecuted markup and model traces; they specify intended relationships and verification plans without claiming a browser, keyboard or screen-reader test.

20 worked examples

1. Native regions

Problem: Identify the primary and navigation regions.

  1. The nav groups the site navigation link.
  2. The main element contains the primary heading.
text Unexecuted synthetic bypass trace
<header><nav><a href="/courses">Courses</a></nav></header><main><h1>Guide</h1></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The markup identifies navigation and main content regions.

Why this result follows: Native elements express the stated structural roles.

2. Distinct nav names

Problem: A page has site navigation and page contents navigation.

  1. Both nav elements represent navigation landmarks in this fixture.
  2. Their labels identify site navigation and page-local contents as different purposes.
text Unexecuted synthetic bypass trace
<nav aria-label="Site">...</nav><nav aria-label="On this page">...</nav>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The regions have distinct labels in the source.

Why this result follows: Names can disambiguate multiple navigation regions.

3. Matching fragment

Problem: A skip link points to main with a matching ID.

  1. The link fragment names content.
  2. The main element has the matching ID.
text Unexecuted synthetic bypass trace
<a href="#content">Skip to main content</a><nav>...</nav><main id="content"><h1>Guide</h1></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The source identifies main as the intended local destination.

Why this result follows: A matching fragment connects the link and target.

4. Missing target

Problem: A skip link points to #main but the content uses id content.

  1. The link fragment names the identifier main as its destination.
  2. The only shown main element instead uses the different identifier content.
text Unexecuted synthetic bypass trace
<a href="#main">Skip</a><main id="content"><h1>Guide</h1></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The intended matching target is absent.

Why this result follows: A fragment must match the destination ID.

5. Duplicate target

Problem: Two elements share the skip target ID.

  1. The same ID appears on two elements.
  2. The source does not provide a unique target relationship.
text Unexecuted synthetic bypass trace
<a href="#content">Skip</a><div id="content">Banner</div><main id="content">...</main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Assign a unique ID to the intended main region and update the link.

Why this result follows: Unique IDs make fragment targets unambiguous.

6. Early link

Problem: A skip link precedes repeated navigation in source.

  1. The link is placed before the repeated navigation block.
  2. Its destination is the subsequent main region.
text Unexecuted synthetic bypass trace
<a href="#content">Skip</a><nav>many links</nav><main id="content">...</main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The source offers a bypass before traversing that block.

Why this result follows: Early source placement supports the intended keyboard route.

7. Tabindex minus one

Problem: Main has tabindex=-1 in a skip-link fixture.

  1. The negative tabindex permits programmatic focus.
  2. It does not add main to ordinary sequential Tab order.
text Unexecuted synthetic bypass trace
<main id="content" tabindex="-1"><h1>Guide</h1></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The markup supports a focusable target without a normal Tab stop.

Why this result follows: Programmatic and sequential focus are distinct behaviors.

8. Display none

Problem: A skip link is hidden with display:none and never revealed.

  1. The link is not rendered under this rule.
  2. It is removed from normal keyboard focus interaction while hidden.
text Unexecuted synthetic bypass trace
.skip { display:none; } <a class="skip" href="#content">Skip</a>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The intended keyboard bypass is unavailable in this state.

Why this result follows: A hidden control cannot serve as a reachable skip link here.

9. Focus reveal

Problem: A focusable skip link moves into view when focused.

  1. The base rule moves the link visually away in the fixture.
  2. The focus rule restores its transform when it receives focus.
text Unexecuted synthetic bypass trace
.skip { position:absolute; transform:translateY(-200%); } .skip:focus { transform:translateY(0); }

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The intended focused presentation is brought into view.

Why this result follows: A focus state can reveal a still-focusable link.

10. Header overlap

Problem: A fixed header covers the focused skip link in the tested layout.

  1. The intended focus state exists in the source model.
  2. The stated paint relationship obscures the control.
text Unexecuted synthetic bypass trace
fixture: skip link focused; fixed header paints over link; no actual browser run

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Adjust and test stacking and placement so focus is visible.

Why this result follows: A focus rule is insufficient if another layer covers the control.

11. Logical inset

Problem: A skip link uses inset-inline-start in left-to-right layout.

  1. The logical inline start is the left side in this stated direction.
  2. The inset is measured from that logical start side.
text Unexecuted synthetic bypass trace
.skip { position:absolute; inset-inline-start:0.5rem; } direction:ltr

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The link is offset from the inline-start side under the fixture.

Why this result follows: Logical inset properties follow the specified writing direction and mode.

12. RTL check

Problem: A link uses logical inset in an Arabic right-to-left page.

  1. Inline start is on the right in this horizontal RTL fixture.
  2. The logical property follows that start side.
text Unexecuted synthetic bypass trace
direction:rtl; .skip { inset-inline-start:0.5rem; position:absolute; }

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The intended placement should be verified in the target layout.

Why this result follows: Logical direction helps adaptation but does not replace testing.

13. Next control

Problem: After a skip target, the next interactive control is a Start button.

  1. The target is placed at the main content boundary.
  2. The button follows the heading in source order.
text Unexecuted synthetic bypass trace
<main id="content" tabindex="-1"><h1>Guide</h1><button>Start</button></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Test the actual focus and subsequent Tab path to Start.

Why this result follows: Destination and onward navigation are separate checks.

14. One main region

Problem: A page has a single visible main containing its primary content.

  1. The main element encloses the primary content.
  2. The surrounding header and footer are separate regions.
text Unexecuted synthetic bypass trace
<header>...</header><main><h1>Article</h1><p>Text</p></main><footer>...</footer>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The source provides one clear primary content region.

Why this result follows: A distinct main landmark helps identify the page’s central task.

15. Context of header

Problem: A header is nested inside an article rather than at page level.

  1. The header introduces content within the article.
  2. Its landmark interpretation depends on context rather than tag name alone.
text Unexecuted synthetic bypass trace
<article><header><h2>Story</h2></header><p>Text</p></article>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Review the actual region structure before adding redundant roles.

Why this result follows: Native semantics can depend on where an element appears.

16. Single nav

Problem: A simple page has one obvious navigation region.

  1. The nav element already expresses a navigation region.
  2. There is no second navigation region to distinguish in this fixture.
text Unexecuted synthetic bypass trace
<nav><a href="/guide">Guide</a></nav><main><h1>Home</h1></main>

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: An extra name is not automatically necessary solely because nav exists.

Why this result follows: Labels should serve the actual navigation context.

17. Focus contrast

Problem: A focused skip link uses white text on a white background.

  1. The text and background have no visible color contrast in the stated fixture.
  2. The focused control’s label cannot be read from that presentation.
text Unexecuted synthetic bypass trace
focused link: color:white; background:white

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Choose and test a readable focused style.

Why this result follows: Focus visibility includes perceivable text and indication.

18. Unstyled link

Problem: The stylesheet fails but the skip anchor and target remain in HTML.

  1. The anchor and matching target are document content.
  2. They are not removed merely because the stylesheet failed.
text Unexecuted synthetic bypass trace
<a href="#content">Skip</a><nav>...</nav><main id="content">...</main>; CSS unavailable

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The source still contains the intended fragment relationship.

Why this result follows: Semantic navigation is not solely carried by presentation.

19. No script dependency

Problem: A regular fragment link is present with scripting disabled.

  1. The href and target exist in the document.
  2. The basic fragment relationship does not require custom JavaScript.
text Unexecuted synthetic bypass trace
<a href="#content">Skip</a><main id="content">...</main>; scripting disabled

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: The source provides a native navigation route to test.

Why this result follows: A real anchor can support navigation without script.

20. Unrun interaction

Problem: The source contains a skip link, but no keyboard test was run.

  1. The source expresses the intended fragment relationship.
  2. No focus visibility or subsequent Tab outcome was observed.
text Unexecuted synthetic bypass trace
source review=matching link/target; keyboard/browser=not performed

The fixture specifies markup or assumptions without claiming an interaction test.

Expected result: Report a prediction and mark the interaction test unrun.

Why this result follows: Markup inspection is not a completed bypass-task test.

Common errors and fixes

The skip link does nothing

Why it happens
Its fragment does not match an existing destination id.
How to fix it
Give the target a unique matching id and verify focus behavior.
Prevent it next time
Test the link from a fresh page load.

The link cannot be reached by keyboard

Why it happens
It was hidden with display:none or removed from the tab order.
How to fix it
Use a visually hidden positioning technique that remains focusable.
Prevent it next time
Tab through the page with no pointer.

The destination is obscured

Why it happens
A fixed header covers the target or the revealed link.
How to fix it
Adjust spacing or stacking and test the actual layout.
Prevent it next time
Check narrow viewports, zoom, and both writing directions.

20 practice exercises

1. Why is tabindex="-1" on main useful here?

Show hint

Separate programmatic focus from an ordinary sequential Tab stop.

Show worked solution

It permits the main region to receive programmatic focus without making it a normal Tab stop. Verify the link’s behavior in supported browsers rather than assuming identical focus handling everywhere.

tabindex="-1" permits main to receive programmatic focus without adding it to ordinary Tab order. Its presence alone does not guarantee activation and focus behavior in every browser; test the link, target and next control in supported environments.

Check your solution

  • The markup permits programmatic targeting of main.
  • Activation and onward navigation are observed in the tested environment.

2. Why should the skip link be visible on focus?

Show hint

A user needs to perceive where focus is in order to activate the link.

Show worked solution

A keyboard user needs to see the focused control in order to understand and activate it. The focused style should also maintain readable contrast and avoid being covered by other content.

The focused link’s label and indicator should be visible with readable contrast and not covered by a fixed header. Test at zoom and narrow width, then activate the link and inspect its destination.

Check your solution

  • The focused link is readable and unobscured.
  • Activation reaches the intended content in the tested environment.

3. A page has site links, a tutorial title and a footer. Design native regions and a heading that make the primary task identifiable.

Show hint

Landmarks and headings provide complementary information.

Show worked solution

Use header containing nav for site links, one main containing an h1 for the tutorial and its primary content, and footer for relevant page footer content. Review the source and landmark map without CSS; do not add a separate landmark for each decorative box.

Check your solution

  • The main region contains the tutorial heading and content.
  • The site links are grouped in navigation apart from main.

4. A page has primary site navigation and a long local table of contents. Design distinct region names and a bypass to the main article.

Show hint

Names identify region purpose; the skip target identifies a different destination.

Show worked solution

Use two nav regions with concise distinct names such as Site and On this page, and an early skip anchor to the unique main article ID. Verify the landmark names, target relationship and actual keyboard route independently in the supported environment.

Check your solution

  • The two navigation regions have distinguishable purposes.
  • The early skip link identifies the main article target.

5. A page has a main article and an aside with related references. Choose native landmarks and explain their relationship.

Show hint

Complementary content should remain meaningful alongside the primary content.

Show worked solution

Use main for the primary article and an aside for related references when they are complementary. Give the aside a useful heading, preserve source order and inspect the landmark structure in supported tools.

Check your solution

  • The primary article is within main.
  • The complementary references have an identifiable aside and heading.

6. A search form needs to be distinguishable from a feedback form in a landmark list. Design accessible names for both regions.

Show hint

A form landmark needs an accessible name to distinguish its purpose.

Show worked solution

Give each form a visible heading and reference it with a unique aria-labelledby value, such as “Search” and “Feedback.” Verify the resulting landmark names in supported assistive technology, and keep labels for individual inputs as well.

Check your solution

  • Each form references its own unique visible heading.
  • The two landmark purposes are distinguishable in the target test.

7. Compare tabindex="-1" and tabindex="0" on a main target for a skip link, and choose based on the intended sequential order.

Show hint

Programmatic focusability and a normal Tab stop are distinct.

Show worked solution

A negative tabindex can permit programmatic focus without adding a normal sequential Tab stop, while zero places an element in sequential focus navigation under applicable browser rules. Choose according to the desired task flow, then test fragment activation and subsequent focus in supported environments.

Check your solution

  • The selected tabindex matches the intended sequential order.
  • Actual target focus and onward navigation are observed in testing.

8. From a fresh page load, specify a keyboard-only test for a skip link followed by a form in main.

Show hint

Check the entire route, not just the anchor’s presence.

Show worked solution

Press Tab to reach the early link, verify visible focus, activate it, observe the target and viewport, then continue Tab to the form control. Record browser, viewport, zoom and any assistive technology; distinguish a failed focus transition from a missing fragment.

Check your solution

  • The focused skip link is visible and activates the intended target.
  • The next interactive control follows a usable task path in the tested setup.

9. A skip link reaches main, but a sticky header covers the beginning of the target after fragment navigation. Propose a targeted repair.

Show hint

The destination’s scroll position can account for the fixed obstruction.

Show worked solution

Consider scroll-margin-block-start on the target or an appropriate scroll-padding on the scrolling container, sized for the header. Verify the target position and focus with the actual sticky header at zoom and narrow widths; do not assume the CSS alone proves the result.

Check your solution

  • The target is not obscured by the header in the target test.
  • Keyboard focus and fragment navigation are observed.

10. A skip link uses logical inset properties. Define a test for English LTR and Arabic RTL at 200% zoom.

Show hint

Logical placement helps, but each actual layout still needs review.

Show worked solution

Test each language and direction with the intended viewport and zoom, checking that the focused link is visible, readable and not covered and that its target heading remains visible after activation. Record the actual browser and results rather than assuming the same placement works everywhere.

Check your solution

  • The link remains perceivable and operable in both tested directions.
  • The target heading is not obscured at the tested zoom.

11. A visible skip link says “Skip to content” but aria-label says “Jump to footer.” Repair its name and test the result.

Show hint

The accessible name should not contradict the visible purpose.

Show worked solution

Remove the conflicting aria-label or make it agree with the visible “Skip to content” text, and keep the href pointing to the intended main target. Test the exposed name and target with supported tools and keyboard navigation.

Check your solution

  • The visible and accessible purposes agree.
  • The link reaches the intended main target in the test.

12. A documentation page needs shortcuts to main content and to a long local navigation list. Design two links and unique targets without confusing their purposes.

Show hint

Each shortcut should name and target the relevant region.

Show worked solution

Place the links early, use distinct descriptive names and unique matching IDs at the main and local-navigation boundaries, and ensure each target makes sense in the task. Test both focus paths and onward navigation in supported environments rather than assuming one shortcut proves the other.

Check your solution

  • Each link has a distinct name and unique matching target.
  • Both routes are tested for focus, destination and onward navigation.

13. A focused skip link has low contrast, while its destination is correct. Define separate visual and navigation checks.

Show hint

Reachability and readability are independent outcomes.

Show worked solution

Adjust the focused foreground, background and indicator to meet the applicable contrast requirements, then verify it is not covered at the target sizes. Separately activate the link and check the main target and next control. Do not treat correct href as proof that focus is perceivable.

Check your solution

  • The focused control is readable and visible under tested settings.
  • Activation reaches the intended main-content path.

14. A page’s native skip link works with scripting enabled, but a script intercepts it. Design a script-disabled test and a safe enhancement principle.

Show hint

The anchor’s href should retain a meaningful native route.

Show worked solution

Keep a real fragment href and unique target so the basic route is available without script. Test with scripting disabled and enabled, inspecting destination and focus in supported browsers; any focus-management enhancement should not silently remove the fallback.

Check your solution

  • The source retains a matching native fragment route.
  • Both script modes are tested and any focus differences are recorded.

15. A single-page interface replaces main content after a route change but keeps a skip link to a removed ID. Design update and test requirements.

Show hint

The target must exist after each relevant state change.

Show worked solution

Maintain a unique target at the start of the current main content or update the link and target together, and define focus management for route changes separately. Test initial load and a synthetic route change, then activate the skip link and verify the current destination and onward keyboard path.

Check your solution

  • The skip target exists and is unique after the route change.
  • The link reaches the current content path in the tested environment.

16. Positive tabindex values make a late navigation link receive focus before the skip link. Repair the order without forcing another positive value.

Show hint

Align source order and ordinary sequential focus.

Show worked solution

Move the skip link early in source and remove unnecessary positive tabindex values from the navigation controls. Test from a fresh load with Tab and Shift+Tab, confirming a logical sequence and visible focus; verify that visual layout does not contradict the task order.

Check your solution

  • The skip link is reachable before the repeated navigation in the tested sequence.
  • The remaining focus order is logical and visibly indicated.

17. A screen-reader landmark list shows main, but a keyboard-only user cannot see the skip link. Explain why one observation does not establish the other.

Show hint

Landmark navigation and sequential keyboard interaction are distinct modes.

Show worked solution

Keep the main landmark and separately repair the skip link’s focusability and visible focused style. Test the landmark map with the supported assistive technology and the keyboard path from fresh load; record both outcomes and the environments used.

Check your solution

  • The main landmark is identifiable in the tested assistive-technology setup.
  • The keyboard user can reach and perceive the skip link in the tested browser.

18. A news site repeats 30 navigation links above every article. Design a bypass and verify that the first article control remains reachable afterward.

Show hint

The bypass should lead past repetition into a useful onward path.

Show worked solution

Place an early descriptive fragment link to a unique main target at the article start, provide visible focus and keep native navigation. From a fresh load test activation, target visibility and the next interactive article control, including a narrow zoomed view.

Check your solution

  • The link bypasses the repeated navigation in the tested path.
  • The next article control is reachable after the target.

19. A visually present main element has aria-hidden="true" on an ancestor. Diagnose the landmark problem and repair it.

Show hint

An ancestor can hide descendants from the accessibility tree.

Show worked solution

Remove the inappropriate aria-hidden from the ancestor containing essential main content, then verify the landmark and its content in supported assistive technology. Keep decorative hidden regions separate rather than hiding the primary task.

Check your solution

  • The main content is not inside an aria-hidden ancestor.
  • The landmark and content are verified in the target tools.

20. A single-page interface keeps two main elements in the DOM, but only the active view should be exposed. Design the landmark state and checks.

Show hint

A hidden inactive view should not remain an additional active main landmark.

Show worked solution

Use a single active main where feasible, or actually hide the inactive view and ensure only the intended main is exposed. Give the active target a unique ID, update the skip link when views change, and verify landmarks and keyboard navigation in supported tools.

Check your solution

  • Only the intended active main is exposed.
  • The skip link targets the current unique main.

Key takeaways

  • Use native landmarks to organize page regions.
  • Make the skip link focusable, visible, and connected to a real target.
  • A skip link needs a unique target at the intended content boundary.
  • Programmatic focus differs from ordinary Tab order.
  • The DOM alone does not establish the complete keyboard experience.

Official references