Scroll margin top

With scroll-margin-top it’s possible to automatically scroll before the selector.

h3 {
  scroll-margin-top: 100px;
Bad example

With a normal anchor url you should have an outcome like the image above. By adding a scroll-margin-top you can have a nicer look. Look at the CodePen for a demonstration.

See the Pen Scroll margin top by Mick (@mickvandijk) on CodePen.

See which browsers supportĀ caniuse