position:fixed在ie6及以下版本下不大好用firefox运行:
<body> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <div style=”position:fixed;right:3px;bottom:3px;”><img src=”http://bbs.blueidea.com/images/default/logo.gif” /></div> </body> </html>
于是用js来解决
<body> <div id=”test” style=”position:absolute;z-index:99;width:200px;text-align:right;”> <img src=”http://bbs.blueidea.com/images/default/logo.gif” /> </div>
<script type=”text/javascript”> var img = document.getElementById(‘test’); function test(){ img.style.top = (document.documentElement.clientHeight – img.offsetHeight + document.documentElement.scrollTop) + ‘px’; img.style.left = document.documentElement.clientWidth – img.offsetWidth + document.documentElement.scrollLeft + ‘px’; } setInterval(test, 250); </script> </body> </html>
#befixiedd{ position: absolute; bottom: auto; clear: both; top:expression(eval(document.compatMode && document.compatMode==’CSS1Compat’) ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) – 1 : document.body.scrollTop +(document.body.clientHeight-this.clientHeight) – 1);}
Name (required)
Mail (will not be published) (required)
Website
Using Gravatars in the comments - get your own and be recognized!
XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>
<a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>
#befixiedd{
position: absolute;
bottom: auto;
clear: both;
top:expression(eval(document.compatMode &&
document.compatMode==’CSS1Compat’) ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight) – 1
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight) – 1);
}