WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: WCAG 2.4.7 and Sticky Navs

for

From: Graham Armfield
Date: Dec 16, 2022 10:29AM


Dear All,

Re fixing this, I've had success using scroll-margin-top and
scroll-margin-bottom (as appropriate) in CSS but I've put those items on
interactive elements in the tab order rather than the nav or a cookie
banner etc.

So in my CSS I'd have:

a:link, button, input, select, textarea (and anything else that can receive
focus)
{
scroll-margin-bottom: 5em; (choose suitable values based on the size of
your sticky content areas)
scroll-margin-top: 5em;
}

Now when you tab around the screen the browser will always pull the element
into view.


Regards
Graham Armfield

coolfields.co.uk <http://www.coolfields.co.uk/>;
@coolfields <https://twitter.com/coolfields>


On Fri, 16 Dec 2022 at 16:42, Jerra Strong < <EMAIL REMOVED> >
wrote:

> Thanks for responding.
>
> Glen, would every site with a sticky nav fail 2.4.7 in Firefox then? Any
> recommendations?
>
> On Thu, Dec 15, 2022 at 5:06 PM Glen Walker < <EMAIL REMOVED> > wrote:
>
> > I typically fail it for 2.4.7
> > > > > > > > > >
> > > > >