named anchors not directing page to proper position

J-Will

[H]ard|Gawd
Joined
Jan 10, 2009
Messages
1,728
I am having some trouble with named anchor (I've tried IDs as well) as refernce points to sub sections of a very lengthy page. When clicking the URL with the reference intro.html#whatevs it works... however...

I have a banner div, that is 150 px in height. When I use position:fixed in order for the banner to not move, which is what I want, then the named anchors seem to be off by 150 px. This makes them not how up in the proper position, and in fact hidden by the fixed position top banner.

How to I fix the named anchor, or ID references so that the links move the page to the proper position to the content. I have tried adding a margin to the anchor tag, but that had no effect. Suggestions?
 
Last edited:
my google-fu must be off today because I cannot even get help from there
 
what I am trying to achieve is a scrollable content area with anchors to the different subsections. So when clicking the URL to that sub section is is displayed on the screen. I cannot get this to work properly as clicking a URL right now moves the section to the top of the page (it should), however that is where the banner is fixed and so the page content is being covered by the banner.
 
Solution:
I ended up having to do in line styling. For some reason, a class for the anchors in CSS would not work. I used- position: relative; top: -150px; to compensate for the banner.

Dont know why it will not work in CSS, but it does in line.
 
Back
Top