直接上代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>IE6 固定</title>
<style>
* html,* html body{background-image:url(about:blank);background-attachment:fixed;} /*防止浮动层在IE6下闪动*/
.fixed{ position: fixed; right: 0; top: 50%; margin-top: -150px; width: 200px; height: 300px; border: 1px solid #ccc;}
.ie6{ _position:absolute; _margin-top: 0; _top:expression(documentElement.scrollTop+(documentElement.clientHeight-this.offsetHeight)/2)} /* ie6 fixed 兼容 */
.hd{ height: 50px}
.bd{ height: 200px}
.ft{ height: 50px;}
.hh{ height: 2000px;}
</style>
</head>
<body>
<div class="fixed ie6">
<div class="hd">标题</div>
<div class="bd">内容</div>
<div class="ft">注释</div>
</div>
<div class="hh"></div>
</body>
</html>