Sticky headers

:target:before {
content: '';
display: block;
height: 3em;
margin: -3em 0 0;
}
  1. Use min-height in your media query,
  2. Take care of keyboard-initiated page scrolling,
  3. Adjust the positioning of in-page links.

--

--

--

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeremy Keith

Jeremy Keith

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

More from Medium

Why You Need A Design System (part 2)

Evaluating design system adoption using custom CSS

An abstract representation of elements on a page. Rectangles, highlighted purple, green, and some with red borders.

Interaction Testing in beta

Style Guides, Design Systems & Component Libraries — Explained