css遮罩层上面跟底层会一起移动,大佬们怎么解决的?[问题已解决]
css代码:
<style type="text/css">
body
{
width:100%;
height: 100%;
margin: 0px;
padding:0px;
background-image: url('【背景】');
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size:100% 100%;
overflow:auto;
}
.zhezhao
{
position: fixed;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
background: #ffffff;
position:absolute;
z-index:1001;
width: 100%;
height: 100%;
text-align: center;
}
.tankuang
{
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
position: relative;
overflow:auto;
background:#ffffff;
background-image: url('【背景】');
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size:100% 100%;
position:absolute;
z-index:1002;
width: 100%;
height:100%;
border-radius: 5px;
margin: 0 auto;
paddimg:5px;
text-align: center;
}
#header-right
{
position:absolute;
z-index:1003;
border-radius: 90px;
background:#c0c0c0;
color:#000000;
right: 2px;
top: 0px;
letter-spacing:1px;
font-size:40px;
border-style:dotted;
border-width:2px;
border-color:#ffffff;
text-align: center;
padding-left:18px;
padding-right:18px;
opacity:0.8;
}
</style>
怎么解决遮罩层跟底层一起移动问题?底层滚动上面一层也跟着动,遮罩层怎么才能全屏?移动端的,有没有解决办法,大家😂百度了好久找不到办法
记得element-ui的v-loading有一个lock修饰符,查了下源码发现它在
body
标签上插入了overflow:hidden
样式。如果是移动端可以尝试监听touchstart
事件,然后禁止浏览器默认行为event.preventDefault()