<!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 charset="utf-8">
<title>position: fixed——webjx.com</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
#content{
height:900px;
}
#demo_r {
background: #f90;
position: fixed;
width: 50px;
top: 300px;
right:0px;
}
</style>
<!--[if lte IE 6]>
<style type="text/css">
html {
/*这个可以让IE6下滚动时无抖动*/
background: url(about:black) no-repeat fixed
}
#demo_r {
position: absolute;
top: expression(offsetParent.scrollTop + 500);
}
</style>
<![endif]-->
</head>
<body>
<div id="demo_r">此处显示 id "demo" 的内容</div>
<div id="content">sssssssssssssssssssssssssssss</div>
</body>
</html>
Ie6下fixed兼容回到顶部
最新推荐文章于 2024-07-03 16:33:21 发布