【发布时间】:2020-05-29 14:50:05
【问题描述】:
当我将固定 div 放置在相对 div 内,并将固定 div 对齐到视口的底部,然后尝试在移动 Safari(iOS 13)中滚动到底部时,我得到了一个奇怪的效果。看起来 div 好像被一个白色矩形遮住了。有没有办法在不改变外部或内部 div 的 position 的情况下防止这种行为?
.outer {
position: relative;
z-index: 1;
display: block;
height: 100%;
overflow: auto;
padding: 5px;
}
.inner {
color: white;
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
width: 100%;
background: blue;
}
<html>
<head>
</head>
<body>
<div class="outer">
<div class="inner">
test test test <br/> test test test
</div>
</div>
</body>
</html>
【问题讨论】:
-
您是否尝试在
.inner类上设置height或min-height?
标签: css mobile-safari