.father{position:fixed;width:100%;height:100%;top;0;left:0;background-color:rgba(0,0,0,.7);}.son{position: absolute;top:0;left:0;bottom:0;right:0;width:50%;height:50%;margin:auto;background-color:red;}
CSS 代码
<div class="father"> <div class="son">上海网页设计 www.021jz.com.cn</div></div>