html,body{
width:100%;
}
#shade{
width:100%;
height:100%;
position: absolute;
background:#333333 ;
opacity:0.5;
filter:alpha(opacity=50);
z-index: 1000;
}
<html>
<body>
<div></div>
</body>
</html>
注意:shade中如果少了position:absolute,则height需要设置如100px这类真实值,否则失效。