ideoneshisy
New Member
There've been a few similar posts (http://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header. It searches for the h2 tags within the article, and then creates anchors links.The problem is I'm using a fixed header. When I click on one of these anchor links, the target h2 is underneath the header. One temporary solution I'm using is:\[code\]h2:target{ padding-top:[header-height];}\[/code\]This works until you scroll back up, and there's a huge gap in the middle of the content. Do y'all have any ideas on how I can offset these anchor links to account for the header? I'd like to keep the HTML as semantic as possible. Any help would be appreciated.Here's a jsFiddle of what exactly I'm talking about: http://jsfiddle.net/aweber9/GbNFv/Thanks.