menu

How to Offset an HTML Anchor to Adjust for Fixed Header?

I have a header that is fixed to the top of the page, so when you link to an anchor elsewhere in the page, the page jumps so the anchor is at the top of the page, leaving the content behind the fixed header (I hope that makes sense). I need a way to offset the anchor by some pixels from the height of the header. I would prefer HTML or CSS, but Javascript would be acceptable as well.

Reference

HTML position:fixed page header and in-page anchors

offsetting an html anchor to adjust for fixed header [duplicate]



KF

Comments