Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title></title></head>
<body [b]id="top"[/b]>
<p><a href="#section">Link to section</a></p>
<p>lots of text...</p>
<h3 id="section">Section</h3>
<p>lots of text...</p>
<p>[b]<a href="#top">Top of page</a>[/b]</p>
</body></html> I've got an IE6 bug that I can't seem to reproduce in a test environment. The above test page works just fine: click on the link to section, and the browser scrolls down to the appropriate anchor as definied by the
id attribute. Click on the "Top of page" link, and the page jumps back to the top, as defined by the id="top" on the <body> tag. All well and good. Except that on one site I have, the link to the top of page just doesn't work in IE6. The markup is identical, the page validates 100% HTML 4.01 Strict, but when you click the link, nothing happens. Works just fine in Firefox and Opera.
Is anyone aware of some obscure IE bug which would explain such behaviour? As the "real" pages use CSS-P extensively (absolute positioning, but with no positioning rules on the
body element), could that have an influence? Thanks in advance for your help.
<a href="#"> works in the particular case described, but it does not entirely solve my problem beacuse on some pages the referenced id is not at the top of the page, but lower. Phantom: as for browser support, IE6 usually supports this just fine - and in my test case, it works very well. This is the first time I've seen IE have problems with using just an id instead of the name attribute.
It appears that IE6 is having trouble referencing id attributes outside of an absolutely-positioned block when the referencing link is within the positioned block. I still haven't isolated the exact cause, but I've got a very strong correlation between the CSS positioning and the bug.
I'll continue breaking down the page with the bug until I find the precise cause, but in the meantime, if anyone else is aware of a known IE bug which might correspond to this situation, I'd be interested.