首页 > Web开发 > 详细

css遮罩层

时间:2017-09-20 00:09:52      阅读:337      评论:0      收藏:0      [点我收藏+]
父元素:position:fixed;
让子元素居中对齐:position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;
<style>
.loading{width:100%;height:100%;position:fixed;top:0;left:0;z-index:100;background:#fff;}
.loading .pic {width:50px;height:50px;background:url(images/loading.gif);position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;}
</style>


<div class="loading">
  <div class="pic"></div>
</div>

 

在线css兼容性处理地址:autoprefixer.github.io

css遮罩层

原文:http://www.cnblogs.com/chenweichu/p/7554582.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!