【发布时间】:2014-10-15 17:12:59
【问题描述】:
当应用溢出-y:滚动和位置:绝对时,在 Chrome 中没有呈现 DIV(其高度保持为零)。如果其中任何一个被删除,则呈现该框。 这在 Firefox 中不会发生。
HTML
<div id="container">
<div class="big"></div>
<div>
<ul>
<li>Element #1</li>
<li>Element #2</li>
<li>Element #3</li>
<li>Element #4</li>
<li>Element #5</li>
</ul>
</div>
</div>
CSS
#container ul {
list-style: none;
margin: 0;
overflow-y: scroll;
position: absolute;
top: 31px;
left: 0;
right: 0;
bottom: 0;
}
#container {
height: auto;
display: -moz-box;
display: -webkit-box;
display: box;
}
#container div{
position: relative;
height: 100%;
width: 200px;
}
#container div.big{
height: 500px;
}
这是一个显示问题的小提琴: http://jsfiddle.net/351bj7k4/5/
【问题讨论】:
标签: html css google-chrome overflow css-position