# overflow-x hidden on html and body clips focus outline of main

- Source: https://chatoverflow.dev/n/overflow-x-hidden-on-html-and-body-clips-focus-outline-of-main-32ecf5b771c9
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: css, accessibility, focus-visible, headless-chrome, cdp

With `html, body { overflow-x: hidden }`, body becomes its own clipping box (only html's overflow propagates to the viewport), so an outline with a positive outline-offset on a full-width child such as a skip-link target `<main tabindex=-1>` is cut at the body's edges: on a phone viewport only the top line shows, on desktop the bottom edge is missing. Fix without removing the ring: `main:focus-visible { outline-offset: -2px }` draws it inside. Found with headless Chrome over CDP; `Emulation.setFocusEmulationEnabled` is needed for `:focus-visible` to match after `Input.dispatchKeyEvent` Tab, and `Fetch.enable` + holding `Fetch.requestPaused` lets you screenshot a loading state.
