Focus Interactive elements, including form controls, links, and buttons, are by default focusable and tabbable. Tabbable elements are part of the document's sequential focus navigation order. Other elements are inert, meaning they are not interactive. With HTML attributes, it is possible to make interactive elements inert and to make inert elements interactive. For usability reasons, always ensure that the user knows which element has focus. Include CSS :focus, :focus-visible, and, optionally, :focus-within styles. This is so important: there are Learn sections devoted to focus styles in both the CSS and Accessibility learning paths. By default, the navigation focus order is the same as the visual order, which is the source code order. There are HTML attributes that can alter this order and CSS properties that can alter the visual order of content. Changing the tabbing order with HTML or visual rendering order with CSS can harm user experience. Don't alter the perceived and actual tabbing order with CSS and HTML. As the following two examples demonstrate, tab orders that differ from the visually expected order are confusing to users and bad for user experience. In this example, the value of the tabindex attribute has made the tab order chaotic: https://codepen.io/web-dot-dev/pen/GRXKqGz In this example, CSS has created a divergence between the tabbing order and the visual order of the content: https://codepen.io/web-dot-dev/pen/KKxPMBV The flex-flow: row-reverse; declaration has reversed the visual order. In addition, the CSS order property was applied to the sixth word, "This", which visually moved that one word. The tabbing sequence is the order of the code, which no longer matches the visual order, creating a disconnect for keyboard users. CSS features, including flexbox, grid, positioning, transforms, and multi-column, can alter the visual order of content. Always ensure your content maintains a logical tabbing order on all viewport sizes. Test your content by tabbing through it with a keyboard: with shift + tab to move backwards through the content. Always ensure it's apparent which element currently has focus with CSS, and avoid accessibility problems by not reordering focusable elements with CSS. Making inert elements interactive The contenteditable and tabindex attributes, being global attributes, can be added to any element, making them focusable in the process. Focusable elements can also be focused with a mouse or pointer, by having the autofocus attribute set, or by script, such as with element.focus(). The tabindex attribute The global tabindex attribute, introduced in attributes, enables elements that otherwise would not be able to receive focus to get focus, usually with the Tab key, hence the name. The tabindex attribute takes as its value an integer. A negative value makes an element focusable but not tabbable. A tabindex value of 0 makes the element focusable and tabbable, adding the element on which it is applied to the sequential focus navigation order in source code order. A value of 1 or greater makes the element focusable and tabbable, but adds it to a prioritized tabbing sequence, and, as we saw above, should be avoided. On this page, the share button, , is a custom element. The tabindex="0" adds this not-normally focusable element into the keyboard default tabbing order: Share The role="button" informs screen reader users that this element should behave like a The autofocus attribute set on the close