我使用PHP动态填充使用li元素的div。我无法将可滚动区域限制为内容。我以前在我的ul中使用了额外空间的垃圾负载,而我仍然是但是当我在css中将高度设置为70%时,它完美地工作。我不明白我是如何动态调整UL中的div
这是因为UL传统上是垂直的,我迫使它水平?
继承人链接到工作现场http://www.evan-livingston.com/test/gallery.php
我的CSS:
div#lasteventimg {
width: 100%;
heigth: 200px;
overflow-x: scroll;
overflow-y: hidden;
position: relative;
}
div#lasteventimg ul {
list-style: none;
height: 70%;
width: 8000px;
margin: auto;
}
div#lasteventimg ul li {
float:left;
display: inline-block;
}
div#lasteventimg img {
width: 200x;
float: left;
}
高度为一个像素值,而不是百分比,这是唯一的区别。 – evanlivingston 2011-05-31 01:48:55
当我将你的ul高度从%切换到px时,它完全一样。 Chrome 10.%vs px不会有所作为。 – mrtsherman 2011-05-31 02:54:08