.group {
background: #000;
margin-left: 25px;
margin-right: 25px;
padding: 15px;
width: inherit;
white-space: nowrap;
overflow-x: auto;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.item{
margin: 3px;
background-color: #ddd;
float: left;
padding: 20px;
width: 200px;
height: 300px;
}
<div class="group">
<div class="item">
<img src="someimage1.png" alt="..." style="height:150px;">
<div>
<h5>Some Text</h5>
<p>Description</p>
</div>
</div>
<div class="item">
<img src="someimage2.png" alt="..." style="height:150px">
<div>
<h5>Some Text</h5>
<p>Description</p>
</div>
</div>
<div class="item">
<img src="someimage3.png" alt="..." style="height:150px">
<div>
<h5>Some Text</h5>
<p>Description</p>
</div>
</div>
</div>
顶行有2个项目,下一个项目转到下一行而不是同一行。我希望所有3行与水平滚动在同一行。我以为float:left正在影响滚动,但是删除将导致所有3个划分都位于单独的行中
尝试这个: