I am trying to create a metro tile style with divs
this is my markup
<div class="tile-tables">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
and this is my CSS
.tile-tables {
height: 270px;
width: 100%;
margin: 0 auto;
background: Red;
overflow: auto;
}
.tile-tables > div {
width: 240px;
height: 240px;
background: green;
display: inline-block;
float: left;
margin: 5px;
}
but the problem is the tile will go to new line if it reach the end of the line.
What i want is the blocks will only have 1 line horizontally and the scrollbar is only at horizontal
Click here for preview http://www.cssdesk.com/uUtBM
Any help would be appreciated..
TIA
You should wrap all the div's you want to be aligned horizontally in a div which has a total width of all the horizontally div's together.
Then put this div inside the .tile-tables, which has an width:100%; / max-width:700px; with an overflow:auto;
Example CSS code here:
jsFiddle