css:
.overlay {
position: fixed; height: 100%; width: 100%;
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7F000000,endcolorstr=#7F000000);
background-color: rgba(0,0,0,.5);
overflow: auto;
}
:root .overlay {
/* IE9+ 支持:root,支持rgba,故把filter设为none */
filter: none;
}
html:
<div class="overlay"></div>
转载于:https://www.cnblogs.com/Zting00/p/7497664.html