Reputation: 4304
I have four nested div elements with float:left
and the fourth element is wrapping below the first due to the length of the container.
.container {
width: 320px;
height: 110px;
overflow-x:scroll;
border: 1px solid blue;
}
.nested {
width: 80px;
height: 80px;
background: red;
float:left;
margin:5px;
}
<div class='container'>
<div class='nested'></div>
<div class='nested'></div>
<div class='nested'></div>
<div class='nested'></div>
</div>
How do I stop the wrapping so that the viewed elements are scrollable in the x axis (or even hidden/truncated)?
Upvotes: 0
Views: 499