I have a div #items
which wraps around a whole bunch of .item
. I want to display the items side by side, and if they exceed the width of the page, display a horizontal scroll bar.
<div id="somediv"></div>
<div id="items">
<div class="item">
Item content
</div>
</div>
<div id="someotherdiv"></div>
I tried something like this but it does not work
#items{
overflow: auto;
width:100%;
height:200px; /* this is the height of each item*/
}
.item{
float:left;
}
I thought this was the way to do it, but I can't get this to way to work, so I'm open to corrections and other ways also.