Say I have this HTML:
<style>
.b{
float:left; width: 300px; height: 300px;
}
</style>
<div style="overflow:hidden;width:300px;height:300px;" id="a">
<div class="b" style="background-color: red"></div>
<div class="b" style="background-color: green"></div>
<div class="b" style="background-color: blue"></div>
</div>
I want the .b divs to sit on one line. However, they only do this when #a‘s overflow is normal.
Add
white-space: nowrap;to#aand remove float:left from.bWith scrollbar
DEMO
Without scrollbar
DEMO 2