DEV Community

Discussion on: Markdown anchor in dev.to post links properly but element ends up behind the top nav-bar.

Collapse
 
elmuerte profile image
Michiel Hendriks

It's a really old browser bug which nobody ever bothered fixing. There are a lot of dirty workarounds, which generally have an effect on the layout.

The problem is that the browser will scroll so that the anchor's top left coordinate is at the top of the content window. But if you have a fixed header up there, your anchor point is behind it.

So basically you should not use fixed headers, or resort to ugly hacks.