让ie6支持fixed最简单和实用的方法

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>让ie6支持fixed的解决方法</title>
    <style>
    *html{_background-image:url(about:blank);_background-attachment:fixed;}/*防止ie6下抖动*/
    body{margin: 0;padding: 0;height: 2000px}
    #fx{height: 250px;width: 300px;background: #ccc;position: fixed;right: 10px;top: 50%;margin-top: -150px;
        _position:absolute;
        _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight/2));
    }
    </style>
</head>
<body>
 <div id="fx">
    <script type="text/javascript">/*728*90,创建于2012-8-23*/var cpro_id = "u1034144";</script>
    <script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
 </div>
</body>
</html>

 

posted on 2013-11-06 14:24  守望星空  阅读(211)  评论(0编辑  收藏  举报

导航