11 of 13
Keep scroll and focus targets clear of sticky headers
Account for the height of sticky headers and footers in the scroll container. After an anchor jump or keyboard focus, the entire target should be visible.
Doscroll-padding-top: 64px
Don’tscroll-padding-top: 0px
Before you ship
- Scroll until the header sticks, open an in-page link to a heading, then Tab forward and Shift+Tab back through the nearby fields. Do the heading and each focus ring clear the header?
- At 200% zoom, does the inset still match the header’s height?
- Inside a scrollable panel, are targets clear of both the sticky header and footer?