On this page
What this issue is
A sticky (or fixed) element stays on screen while the page scrolls. Common examples are a top navigation bar, a promo banner, a cookie notice and a floating chat or checkout bar. When someone moves through your page with the Tab key, the browser scrolls the focused control into view. It does not know about your sticky bar, so the control can land underneath it.
- Tab to next fieldFocus moves up the form as the user tabs backwards or forwards
- Browser scrollsIt scrolls the field just to the viewport edge
- Header covers fieldSticky header sits over the focused input
- User types blindNo visible cursor or focus ring
- Form abandonedErrors or wrong entries go unnoticed
The focus moves on, but the field sits under the header, so the user cannot see what they are typing into.
Why it costs you leads or sales
People who navigate by keyboard include screen magnifier users, people with motor impairments and power users who simply prefer Tab. If they cannot see the focused field, they mistype, skip required fields or give up on the form or checkout. The same happens to anyone on a short laptop screen or a zoomed browser, where a tall sticky header takes up much of the viewport.
Example: on a 700px-high window (zoomed or small laptop), the taller the sticky bars, the less room is left for the focused field.
How to check if your site has it
Open a long page with a form
Use your contact, checkout or booking page. Scroll to the top.
Tab forwards through every control
Watch whether each focused link, field and button stays visible below the sticky header.
Tab backwards with Shift+Tab
Moving up the page is where fields most often slide under a top header.
Repeat at 200% zoom and on a small window
Sticky bars take up more of the screen, which exposes the problem faster.
Test with banners open
Leave the cookie notice, promo bar and chat widget showing, since they also cover focus.
How to fix it
The cleanest fix is CSS. scroll-padding-top on the html element tells the browser to leave that much space at the top when it scrolls something into view, including for focus. scroll-margin-top does the same for a single element.
:root {
--header-height: 88px; /* match your real header height */
}
html {
scroll-padding-top: calc(var(--header-height) + 16px);
}
/* Optional: per element */
input, select, textarea, button, a, [tabindex] {
scroll-margin-top: calc(var(--header-height) + 16px);
}Open custom CSS
Go to Appearance > Customize > Additional CSS (or Appearance > Editor > Styles > Additional CSS in block themes).
Paste the snippet
Set --header-height to your theme's sticky header height. If the header height changes on mobile, add a media query.
Edit theme CSS
Go to Online Store > Themes > Edit code and open your main stylesheet (often base.css or theme.css).
Add the rule
Paste the snippet at the end. Some themes already set scroll-padding-top, so search the file first to avoid a conflict.
Add custom code
Open Site settings > Custom code and put the CSS inside a style tag in the Head code. Or set it on the html tag in the Style panel.
Publish and retest
Check on the published site, not only in the Designer.
Add custom CSS
Wix Studio lets you add custom CSS through the site's code options. The standard Wix editor offers less control, so test carefully, and consider making the header non-sticky if the rule has no effect.
Use Custom CSS
Go to Website > Website Tools > Custom CSS and paste the snippet. Match --header-height to your fixed header.
Add to your global stylesheet
Add the snippet once so it applies on every page.
Handle dynamic bars
If a banner appears or hides, update the variable with JavaScript so the padding matches the current total height.
function updateScrollPadding() {
const bars = document.querySelectorAll('[data-sticky]');
let total = 0;
bars.forEach((el) => { total += el.getBoundingClientRect().height; });
document.documentElement.style.scrollPaddingTop = (total + 16) + 'px';
}
window.addEventListener('load', updateScrollPadding);
window.addEventListener('resize', updateScrollPadding);How to confirm it's fixed
- Tab and Shift+Tab through the whole form: every focused control is visible below the header.
- Test at 200% zoom and in a short browser window.
- Test with the cookie banner, promo bar and chat widget open.
- Check bottom sticky bars too, such as a mobile add-to-cart bar.
- Test on mobile with an external keyboard if your audience uses one.
- Check the published site, not just the editor preview.
How to prevent it happening again
Before
- Header height hard-coded nowhere
- Focused fields slide under the bar
- New banners added without a keyboard test
After
- scroll-padding-top matches header height
- Focused fields stay in view
- Keyboard pass is part of every design change
Whenever you change the header, add a banner or install a chat widget, repeat the Tab test. Add an accessibility scan and a keyboard pass to your release checklist so it is not left to chance.
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. FunnelGuard runs your customer journeys on a schedule and watches steps, tracking hits and test leads, but it does not judge how a page looks to a keyboard user. The kind of tool that fits is an accessibility testing tool: a browser extension or automated scanner for WCAG issues, combined with a manual keyboard and screen magnifier test like the one above.
Where FunnelGuard can help is the neighbouring risk: after a header or banner change, it can confirm that your form still submits and your test lead still arrives. You can start with the Free plan (1 site, 2 journeys, daily checks, no card).
Questions people ask
Why is my form field hidden behind the sticky header when I press Tab?
The browser scrolls the focused field to the edge of the viewport and does not account for fixed or sticky elements. The header then sits on top of it. Setting scroll-padding-top on the html element to the header height fixes this in modern browsers.
What is WCAG 2.4.11 Focus Not Obscured?
It is a WCAG 2.2 level AA criterion. It requires that when an element receives keyboard focus, it is not entirely hidden by content you author, such as sticky headers, cookie banners or chat widgets. Partly hidden still passes at this minimum level.
How do I stop a sticky header covering focused elements with CSS?
Add html { scroll-padding-top: 100px; }, using a value slightly larger than your header height. You can also set scroll-margin-top on individual elements. Both tell the browser to leave space when scrolling focus into view.
Does a cookie banner or chat widget count as obscuring focus?
Yes. Any author-created content that overlays the focused element can fail 2.4.11, including bottom cookie bars, floating chat buttons and sticky add-to-cart bars. Test with them open.
Is partly covered focus a WCAG failure?
Not at the minimum level 2.4.11, which fails only when the focused element is entirely hidden. The stricter AAA criterion 2.4.12 requires that no part is hidden, so aim for fully visible.
How do I test if focus is hidden by a sticky header?
Open a long page, press Tab and Shift+Tab through every control and watch whether each one stays visible. Repeat at 200% zoom and with banners open. An automated scanner cannot reliably catch this, so a manual pass is needed.
Can FunnelGuard detect focus hidden behind a sticky header?
No. This needs an accessibility testing tool and a manual keyboard check. FunnelGuard checks that your funnel steps, tracking and lead delivery work, which is a different job.
Related issues
- PRF-311Focus outline removed (outline:none)Fix guide
- PRF-313Form cannot be completed with keyboard onlyFix guide
- PRF-314Illogical focus orderFix guide
- PRF-315Focus not moved into opened modal / not returned on closeFix guide
- PRF-312Keyboard trap in modal or widgetFix guide
- PRF-317Missing skip linkFix guide