Clicking a footnote link scrolls to the note, but when several notes fit on the screen it is not obvious which one you landed on. :target matches the element whose id is in the URL fragment.
.footnotes li:target,
h2:target {
background: #fff3bf;
animation: fade-mark 2s ease-out 1s forwards;
}
@keyframes fade-mark {
to { background: transparent; }
}
When the URL ends in #fn-3, the element with id="fn-3" matches :target. I give it a yellow background that fades out after a second, so the reader sees where they are without a permanent marker. It also works when someone opens a shared link with a fragment, which makes it nice for headings with anchor links.
No JavaScript is needed and it has worked in browsers forever.
A few things to know. Only one element can be the target at a time. Changing the hash with history.pushState() does not update :target, while setting location.hash does. And the highlight comes back every time the page is reloaded with the fragment still in the URL, which is mostly fine but can look odd on a page people refresh a lot.
Further reading: MDN: :target