How to fix tab order on your website
Tab order is the sequence in which links, buttons and form fields get highlighted when someone presses the Tab key. To fix it, make the page's underlying order match what people see on screen, and remove anything that forces focus to jump around.
Some visitors never use a mouse. They press Tab to move from one link or button to the next, and Enter or Space to use it. If the highlight leaps from the header to the footer, then back to a menu item, they lose track of where they are. That is an illogical tab order, and it is one of the most common accessibility problems on business websites.
What the problem looks like
Put your mouse aside, click once on a blank part of the page, and press Tab repeatedly. Watch the outline or highlight that shows which item is active (this is called focus). A healthy page moves through things in the order you would read them: usually top to bottom, left to right (or right to left on languages that read that way). Signs of trouble:
- Focus jumps from the top of the page to the bottom, then back up.
- A button in the right column is reached before the form on the left.
- Focus disappears: you press Tab and cannot see where it went.
- Focus goes to things hidden behind a menu or popup you cannot see.
- After closing a popup, focus restarts at the top of the page instead of where you were.
Why it matters
Keyboard users include people with motor disabilities, people who use screen readers, people with a broken wrist or a dead mouse battery, and many fast typists who simply prefer it. If your checkout, contact form or booking button is reached in a confusing order, some of them will give up. That costs you enquiries and sales, and it signals carelessness.
It is also a standard. WCAG (the Web Content Accessibility Guidelines) has a rule called 2.4.3 Focus Order at Level A, the basic level, which says the order must preserve meaning and usability. Related rules are 2.4.7 Focus Visible (you must be able to see where focus is) and, new in WCAG 2.2, 2.4.11 Focus Not Obscured (Minimum) (the focused item must not be entirely hidden behind things like sticky headers or cookie banners). Accessibility rules differ by country, so ask your adviser what applies to you, but a logical order is a safe baseline anywhere.
How to check your site for free
- Open your most important pages: home page, contact page, checkout or booking page.
- Click on empty page space, then press Tab and keep going. Press Shift+Tab to go backwards.
- Ask at each step: can I see where focus is, and is this the item I would expect next?
- Open the menu, any popup, a cookie banner and a form using only the keyboard. Make sure you can also get out again with Escape or a close button.
For a visual map, the free browser extension Accessibility Insights for Web has a Tab stops view that draws numbered lines between items in order. Chrome's Lighthouse and the WAVE tool catch some related issues, but no automatic tool fully judges whether an order makes sense, so the manual test matters.
SiteMonday checks this as part of its week 7 WCAG 2.2 accessibility audit, with a written report and ranked fix list. It finds and explains the problem, and the fix is up to you or your developer.
How to fix it in general
Browsers follow the order of elements in the page's HTML, not how the page looks. So a bad tab order almost always means the visual layout and the underlying order disagree. Common causes and fixes:
- Positive tabindex values. If a developer or plugin added
tabindex="1",tabindex="2"and so on, those items jump the queue. Remove them. The only values you normally need aretabindex="0"(make a custom element focusable in its natural place) andtabindex="-1"(focusable by script only, not by Tab). - Layout tricks that reorder visually. CSS such as
order,flex-direction: row-reverse, grid placement or absolute positioning can move things on screen without moving them in the HTML. Reorder the HTML itself so it matches the visual order, or simplify the layout. - Elements in the wrong place in the HTML. A popup or sidebar added at the very end of the page but shown at the top will be reached last. Place it logically, or manage focus when it opens.
- Clickable things that are not real buttons or links. A
divwith a click handler cannot be reached by Tab at all. Use a realbuttonoraelement. - Hidden items still focusable. Menus or panels hidden visually but still in the page can trap focus on invisible items. Hide them properly (with
display: noneor thehiddenattribute). See also focusable items hidden with aria-hidden. - Popups that do not manage focus. When a dialog opens, focus should move into it and return to the trigger on close. If people get stuck inside, read about keyboard traps in modals. The native HTML
dialogelement opened withshowModal()handles much of this for you.
Common platforms
Menu names and settings depend on your theme, version and any page builder, so treat these as pointers.
- WordPress: the order usually comes from the theme template and from page builder sections. Look for a theme or plugin that adds
tabindexvalues, and check popups and sticky headers. See the WordPress guide. - Shopify: the theme's Liquid files control the order, and apps that inject popups or chat widgets are frequent culprits. See the Shopify guide.
- Wix, Squarespace, Webflow: the order often follows the stacking or layer order of elements in the editor. Look for an option to view or reorder layers or the page structure, and arrange items to match reading order. Overlapping or dragged elements are the usual cause.
- Custom code or React: check for positive
tabindex, reordering CSS and components rendered in a different place from where they appear.
If you cannot change a theme or builder yourself, send your developer the exact steps you used to reproduce the problem and the page address.
How to confirm the fix worked
Repeat the Tab test on every page you changed. Go forward and backward with Shift+Tab. Check that focus is always visible, that nothing is skipped or reached out of order, and that popups open and close cleanly. Test on a phone-sized window too, since layouts often reorder at small widths. Run the Tab stops view in Accessibility Insights for a second opinion.
How to stop it coming back
- Add a quick Tab test to your checklist whenever you change the theme, add a plugin, or publish a new landing page.
- Avoid positive
tabindexvalues as a house rule. - Prefer simple layouts where the order on screen equals the order in the code.
- Test popups, banners and chat widgets with the keyboard before switching them on.
- Recheck after major updates, since themes and builders can change markup.
Step by step for your platform
- Illogical tab order on WordPress
- Illogical tab order on Shopify
- Illogical tab order on Wix
- Illogical tab order on Squarespace
- Illogical tab order on Webflow
- Illogical tab order on Elementor
- Illogical tab order on React
Questions
What is tab order on a website?
It is the order in which links, buttons and form fields receive focus as someone presses the Tab key. It should follow the visual reading order of the page.
Is a bad tab order against WCAG?
Yes. WCAG 2.4.3 Focus Order (Level A) requires a sequence that preserves meaning and usability. Legal requirements vary by country, so check what applies to you.
Should I use tabindex to fix the order?
Usually no. Positive values like `tabindex="1"` tend to make things worse. Fix the order of the HTML instead, and use only `tabindex="0"` or `-1` when needed.
Why does the tab order differ from what I see on screen?
Browsers follow the order of the HTML, while CSS can rearrange how things look. When the two disagree, focus appears to jump around.
Can an automatic tool find every tab order problem?
No. Tools can flag related issues such as positive tabindex values, but judging whether an order makes sense needs a person pressing Tab through the page.
Do I need a developer to fix it?
Sometimes not. On site builders you can often rearrange layers or sections yourself. For theme code, positive tabindex values or CSS reordering, a developer is usually the quicker route.