Fixed Headers and Jump Links? The Solution is scroll-margin-top | CSS-Tricks

I didn’t know about scroll-margin-top! I wonder if you could apply a universal rule …like, say you’ve got a fixed header that’s 2em in height, couldn’t you declare:

:target { scroll-margin-top: 2em; }

Fixed Headers and Jump Links? The Solution is scroll-margin-top | CSS-Tricks

Tagged with

Responses

Related links

Polishing your typography with line height units | WebKit

I should be using the lh and rlh units more enough—they’re supported across the board!

Tagged with

Tagged with

Designing better target sizes

This is a wonderfully in-depth interactive explainer on touch target sizes, with plenty of examples.

Tagged with

Revealing ‘back to top’ button

Such a clever minimalist use of CSS!

Tagged with

The perfect link - The A11Y Collective

How do we write, design, and code a link that works for everyone on every device? Let’s dive into the world of creating the perfect link, without making a pig’s breakfast of it.

Tagged with

Related posts

Underlines and line height

How to make the distance of link underlines proportional to the line height of the text.

Making the website for Research By The Sea

Having fun with view transitions and scroll-driven animations.

Cascading Style Sheets

The terminology of applying CSS.

Everything You Know About Web Design Just Changed by Jen Simmons

A presentation at An Event Apart Seattle 2018.

Sticky headers

A few things to remember if you’re going to using position:fixed.