为什么加了遮罩了就不能滚动了?

tomorrow93 2017-07-31 11:11:44


如图,当优惠券多的话(6个以上)就不会滚动了,无论怎么滚动只是body动而已,遮罩层不动,这是怎回事?



<!--弹出 - 优惠券-->
<div id="zhezhao_voucher">
<div class="voucher ">
<div class="container">
<h3>优惠券<img src="images/de_close.png" class="voucherImg"></h3>
<div class="voucherList">
<div class="voucher_left">
<h1><span>¥</span>50</h1>
<p>满400可用</p>
</div>
<div class="voucher_right">
<h2>优惠券50元</h2>
<h4>适用部分商品</h4>
<p>有效期:2017/07/25 24:00</p>
</div>
<button class="voucher_BtnTake">领取</button>
</div>
</div>
<button class="voucher_BtnOK Mtop10">完成</button>
</div>
</div>


遮罩写法:
#zhezhao_voucher
{
background-color: rgba(0,0,0,0.3);
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 50000;
}
...全文
266 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
中式小面包 2017-07-31
  • 打赏
  • 举报
回复
1,因为你的遮罩层height是100%,没得滚动; 2,一般来说应该是在包裹内容的div给设个height(或max-height),然后overflow-y:scroll,这样内容区域就有个滚动条; 3,外面不要滑动的话,弹出遮罩层的时候给body加个height,然后overflow:hidden

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧