TLDR Web Dev · ARTICLES & TUTORIALS
OVERENGINEERED ANCHOR LINKS
Summary from the TLDR Web Dev newsletter
Anchor links often have an issue of not scrolling to the correct section on a site, especially for headings near the bottom of the page. This article goes over solutions, starting with simple fixes like adding extra padding or shifting the trigger line. The final solution fixes anchor link positioning by minimizing the mean squared error (MSE) while still keeping relative section spacing.