I have a URL with an anchor that is working as it should:
site.com/item/id#comment-233
When opened, the anchor will be positioned at exactly the top of the page.
How do I change the starting point? Let’s say I want it to be 50px down from the top.
The reason I’m needing this is because I have fixed layers at the top of the page, so the comment is appearing overlapped behind the fixed header div.
Just in case, because of cross-browser compliance I prefer a solution that does not involve changing the container of the comment to fixed and positioning top minus the height of the header.
Assuming your
<a>tag has no content, add a class to it tag with aposition:relative; top:-50px;Depending on your document, you my also have to wrap it in an absolute
<div>This should be cross-browser compatible if implemented correctly.
EDIT
This is the test I’ve done locally and it works fine in FF 3.6