Add a skip to main content link that moves focus

  • Make the link the first thing a keyboard user reaches, and point it at the main content's id. It can stay hidden until it receives focus, but it has to appear then.

  • Activating the link should move keyboard focus to the main content, which is the last test in W3C's skip-link technique.

Keep the keyboard focus indicator visible

Keep the tab order logical for keyboard navigation

  • A positive tabindex puts an element ahead of ordinary controls in the tab sequence. Prefer a logical document order and native links or buttons instead of numbering controls to repair the layout.

  • MDN's tabindex reference distinguishes 0, which follows document order, from -1, which can receive focus programmatically without joining the normal Tab sequence.

Frequently asked questions

Does a skip navigation link have to stay visible all the time?

No. W3C prefers links that are always visible, but a link that appears only when it receives focus still meets the technique.

Does a skip to main content link replace keyboard accessibility testing?

No. The link handles one shortcut. Try the tasks people come to the page for with the keyboard alone, too.

Do I need a skip link if my page uses landmarks and headings?

Not always. WCAG's Bypass Blocks lists ARIA landmarks and headings at the start of each section as sufficient techniques, beside a skip link.