1
我有一個overflow-x:scroll
和overflow-y:hidden
。我有圖像,但是當我試圖讓它只能水平滾動時,它不起作用?當我突出顯示圖像並向下拖動突出顯示時,它會垂直向下滾動。旋轉木馬像用CSS,溢出-x(僅水平)
#contents
{
margin:0 auto;
text-align:center;
width:1200px;
clear:both;
}
#image_contents
{
float:left;
height: 208px;
overflow-x:scroll;
overflow-y:hidden;
margin:0 auto;
}
.images
{
float:left;
margin:2px;
background:#000;
overflow:hidden;
position:relative;
display:inline-block;
}
<div id="contents">
<div id="image_contents">
<div class="images">
<img src="1.jpg"/>
</div>
<div class="images">
<img src="2.jpg"/>
</div>
<div class="images">
<img src="3.jpg"/>
</div>
<!-- and so forth !->
</div>
</div>