使用叠加层停用整个网页 [英] Disable whole page with an overlay
本文介绍了使用叠加层停用整个网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个叠加层,我将在弹出窗口后面使用。但是当页面向下滚动覆盖是没有更多的?我可以使用javascript来获取页面内容的高度,然后可以应用相同的高度来覆盖,但是有任何基于css的解决方案吗?
I want to create an overlay that I will use behind a popup. But when the page is scrolled down the overlay is no more there? I can use javascript to get the height of page's content and then can apply same height to overlay but is there any css based solution?
#overlay{
width: 100%;
height: 100%;
position: absolute;
left: 0px;
top: 0px;
background-color:#000;
opacity: .75
}
推荐答案
只需将位置
属性更改为固定
。
这篇关于使用叠加层停用整个网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文