Here's the code I'm currently using which works fine in Chrome, Safari, FF, Opera, but not in IE6. (Haven't tested IE7/8)

<div style="position:fixed;width:100%;top:0;">
</div>

What I need is for the header of my page to stay at the top, regardless of page scroll. I've been searching the net for a fix and have come up empty handed. I'd prefer not having to resort to javascript.

So I guess the problem is that IE6 doesn't implement the fixed position. So for those curious I found a page describing how to work around this. Between that and the other comments on the page (as referenced by the author) the solution works smoothly without the need for any javascript.

http://www.howtocreate.co.uk/fixedPosition.html

Actually, IE implements fixed positioning wrong. It does not follow the standard.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.