So this one's been stumping me. What I need is an absolutely positioned container with an css expression that pins it to the bottom of the page (to compensate for wonkiness in simulating fixed positioning for doctypeless or DTD-less IE), while containing another absolutely posi开发者_运维知识库tioned element that at some point is below the browser's viewport. Since this is content that will be included in others' webpages, I can't depend on a proper doctype for this to display correctly. Anything that puts the inside element below the viewport---padding, margins, or positioning--will cause the page to scroll forever in IE.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<style type="text/css">
#footer {
position: expression("absolute");
_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);
width:800px;
height:800px;
background-color:blue;
}
#huh {
position:absolute;
bottom:-20px;
width:400px;
height:400px;
background-color:red;
}
<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh
<div id="footer">
<div id="huh">
</div>
</div>
</body>
</html>
Needing both to be absolutely positioned really ties my hands on this. Relatively positioning the huh div messes with the display of the wrapper in my non-test case. Any ideas?
精彩评论