I have several columns floated within a container. The container width is responsive (100%), and will be different widths based on users window sizes. When the columns cannot fit within the containers, I want it to automatically go into a horizontal scroll. I would have thought my styling would have achieved this, but it doesnt work. In the example I showed 9 columns, but based on various scenarios there may be different numbers from 3-15. There is also a preloader within there too. The children elements cannot be in-line block, or have overflow hidden.
#container {
overflow-x: scroll;
position: relative;
white-space: nowrap;
width: 100%;
}
.column {
float: left;
width: 300px;
}
#preloader {
display: none;
height: 100%;
width: 100%
}
.clr {
clear: both;
}
<div id="container">
<div id="preloader"></div>
<div id="columns">
<div class="column">1</div>
<div class="column">2</div>
<div class="column">3</div>
<div class="column">4</div>
<div class="column">5</div>
<div class="column">6</div>
<div class="column">7</div>
<div class="column">8</div>
<div class="column">9</div>
<div class="clr"></div>
</div>
</div>
How can I make this work smoothly and seamlessly?