日期:2014-05-16 浏览次数:20696 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>IE6 position:fixed</title>
<style type="text/css">
* { margin:0; padding:0;}
#content{ height:2000px; }
#a{ position:fixed; bottom:0; right:0; width:200px; height:60px; background:#F00;}
/*IE6 fixed bug*/
* html{overflow:hidden;}
* html body{height:100%;overflow:auto;}
* html #a{position:absolute;right:18px;}
</style>
</head>
<body>
<div id="content">
IE6 position:fixed
</div>
<div id="a">IE6 position:fixed</div>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
body {
height:1200px;
}
.floatDIV {
width:100px; height:100px;
background:#ddd;
top:100px; right:10px;
/* not ie6 */
position:fixed;
/* ie6 */
_position:absolute;
_top:expression(documentElement.scrollTop + 100);
}
html {
_background:url(about:blank); /* 阻止闪动 in IE6,把空文件换成about:blank,减少请求 */
}
</style>
</head>
<body>
<div class="floatDIV">
123
</div>
</body>
</html>