我的代码如下:允许溢出X
#under {
width: 100%;
height: 50px;
background-color: #D4D4D4;
border: none;
-webkit-box-shadow: inset 0px 0px 4px 0px #000000;
-moz-box-shadow: inset 0px 0px 4px 0px #000000;
box-shadow: inset 0px 0px 4px 0px #000000;
overflow-x: scroll;
white-space: nowrap;
}
#under ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#under ul li {
min-width: 100px;
height: 40px;
margin-top: 10px;
margin-left: 10px;
float: left;
background-color: #999;
display: block;
}
基本上,我有与它里面li元素的#under DIV。我希望他们'溢出'的容器,以便它可以在X轴上滚动,但我不能为我的生活找出如何做到这一点!
它将使li元素显示在彼此之下。
任何帮助表示赞赏,谢谢!
编辑:活生生的例子https://babblebox.me/mobile/
*“我希望他们'溢出'的容器,以便它可以在X轴上滚动,但我不能为我的生活弄清楚为什么。”* - 你不能f明白为什么你想这样做? ;) – Polynomial
无论如何,我想你错过了你的一句话。究竟是什么问题? – Polynomial
您正在使用哪种浏览器?此属性在IE8及更早版本中不起作用。 –