Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a <a> with padding or margin

Status
Not open for further replies.

Chucklez

Programmer
Jul 25, 2002
104
US
Hi all. Hopefully someone can help me out a bit here. On a site I am developing I have a header and footer that does not move while allowing scrolling in the middle section.


I am also using <a> tags to move to certain topics in a FAQ section of the page. Well, with me using a fixed header, when I click the link to take me to the topic, the topic is displayed under the header. I have tried using padding and margin in my css, but that doesent work. The only other thing I can think of is to put the anchor point in the topic above the one I want to actually view, but that seems very sloppy to me.

Anyone have any other ideas on how to do this?
 
use the element ID as the target for the named anchor, it's a little more "accurate"

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
 
There's nothing you can really do in this design. You can drastically change your layout to not work with fixed header in this way, or to scroll only the #Content section. If you want to keep the current layout, you can give your #Content enough margin-top to bring it from under the header. That will cause your first page to have a larger gap between the header and content, but if you can live with that, that's the easiest way out.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
I really dont want to do that. Looks like I may go with the sloppy route and just move my anchor tags to the section above. It wont be correct, but will atleast display accurately
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top