您的位置:首页 > 其它

兼容ie6的position:fixed,但所有的定位将全变成fixed

2013-03-28 16:47 363 查看
<!DOCTYPE html>
<html>
<head>
<style>
body{margin:0;padding:0;}

html{_overflow:hidden;}
body{_overflow:auto;_height:100%;}
.fixed{right:17px;position:fixed;top:10px;_position:absolute;}

</style>
</head>
<body>

<div style="position: relative;top:40px;left:10px;background-color:blue;">
变成了fixed
<div style="position:absolute;top:100px;left:50px;background-color:red;">也变成了fixed</div>
</div>
<div style="height:600px;background-color:orange;top:0px;"></div>

<a href="javascript:window.scroll(0,0);" target="_self" class=fixed>回顶部</a>
</body>

</html>





看来这么hack,用处不大
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: