用CSS实现跟随滚动条漂浮层

来源:互联网 发布:我的世界手机创世神js 编辑:程序博客网 时间:2024/05/21 06:12
<!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>
    <title></title>
    <style>
.header {
    padding: 10px 0 0;
    position: fixed;
    width: 300px;
    height:50px;
    background-color:#000;
    opacity: 0.2;
    filter:alpha(opacity=20);   
}
    </style>
</head>
<body>
        <div style="position: absolute; left: 0pt; top: 100px;">
            <div class="header">
            </div>            
        </div>
<div style="height:2000px; background-color: #DEFBFF;"></div>
</body>
</html>

原创粉丝点击