弹窗页面设计

2017-08-08  本文已影响0人  guoss

页面结构如下,当我们设置没有设置body的高度时候,页面上默认是视口的高度,同时设置overflow:hidden,所以滑动的时候底部超出的自然就不会展示出来;当我们不设置overflow:hidden的时候,自然底部的滚动也就能展示出来

<div class="pop">
  <div class="mask"></div>
  <div class="pop-main">
  </div>
</div>

mask设置

    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

需要显示的元素设置

    z-index: 10;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: url(/img/pop-small_591dc162.png) center top;

第二种方法设置position: absolute

上一篇 下一篇

猜你喜欢

热点阅读