固定位置显示弹出层(兼容IE6,IE8,FF)
(编辑:jimmy 日期: 2024/11/26 浏览:3 次 )
css样式:
复制代码代码如下:
<style type="text/css">
body{_background-attachment:fixed; _background-image:url(nothing);}
#status-box{width:100px; height:100px; color:#FFF; background-color:black; position:fixed; _position:absolute; bottom:0;_top:expression(documentElement.scrollTop+document.documentElement.clientHeight-100); right:0;}
#cs{background-color:#ccc;width:200px;height:120px;position:absolute;left:100px;top:100px;}
</style>
body:
复制代码代码如下:
<body>
<div id="cs">随页面走动</div>
<div style="height:900px;"></div>
<div id="status-box">静态层</div>
</body>
复制代码代码如下:
<style type="text/css">
body{_background-attachment:fixed; _background-image:url(nothing);}
#status-box{width:100px; height:100px; color:#FFF; background-color:black; position:fixed; _position:absolute; bottom:0;_top:expression(documentElement.scrollTop+document.documentElement.clientHeight-100); right:0;}
#cs{background-color:#ccc;width:200px;height:120px;position:absolute;left:100px;top:100px;}
</style>
body:
复制代码代码如下:
<body>
<div id="cs">随页面走动</div>
<div style="height:900px;"></div>
<div id="status-box">静态层</div>
</body>
下一篇:CSS多浏览器兼容性(IE和Firefox)技巧大全推荐