View Full Version : Losing internal links under a fixed header in IE

02-01-2005, 01:26 PM
Hello everyone,

I'm a beginner at this so I would appreciate any help you could give me. I've designed a set of pages for a class (Open University, UK) with several "position:fixed" elements (or IE emulations of "position:fixed", with overflow for the html element set to hidden, and overflow set to auto for the body element) and my main content scrolls under a fixed header. I'm quite pleased with the design, however I'm having trouble linking to internal anchors in the normal way. The following

<a href="#note1">Note 1</a>

results in "Note 1" appearing at the top of the viewport where it is concealed by my fixed header. I was trying to get a JavaScript scrolling solution to work, but Willy Duitt on the JavaScript forum thought there must be some answer to the problem in CSS. He suggested adding some padding to my named anchors. I tried it and it works in Firefox and Netscape 7, but not in IE. That may have something to do with the dodgy CSS I've used to get IE 6 to emulate position:fixed.

I've put what I've got so far up on my personal webspace for you to see, with two links on the index page - one to a named anchor on the same page, and one to a named anchor on another page (both link to paragraphs starting with the word "HERE".) Can anyone think of a way to get these links to work as intended in IE as well as other browsers?