【发布时间】:2017-05-04 08:12:16
【问题描述】:
我将我的 chrome 更新到版本 55,现在我在 div overflow: hidden; 中的 position: fixed; 不再工作了。
这是一个例子: http://codepen.io/PRDev/pen/mOvwOO
.container {
background: #d3d3d3;
}
.overflow {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
z-index: 1;
}
.parallax {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #dfdfdf;
}
.next-section {
position: relative;
z-index: 10;
height: 200vh;
}
<div class="container">
<div class="overflow">
<div class="parallax">
<h1>Headline</h1>
<p>Lorem ipsum</p>
</div>
</div>
<div class="next-section">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
当我向下滚动时,文本在 div 溢出隐藏之外仍然可见,在 safari 和 chrome 54 上它是隐藏的,但在最新的 Chrome 55 中不可见。
在 .overflow 中的 chrome 54 文本隐藏在下一节中的文本后面,在 chrome 55 上,溢出中的此文本在下一节后面可见
【问题讨论】:
-
您能否更清楚地说明这个问题?我的意思是,很明显你的“溢出”类不会将“下一节”中的文本作为子元素,那么你为什么希望它在溢出时隐藏
-
你需要什么
-
当你向下滚动你想隐藏
.parallaxdiv 对吗? -
在 .overflow 中的 chrome 54 文本隐藏在 .next-section 中的文本后面,在 chrome 55 上,.overflow 中的此文本在 .next-section 后面可见
-
@JishnuVS 是的,我想隐藏 .parralax div
标签: html css google-chrome