I'm trying to create a grid with div elemtents and it looks like this at the moment:
"2" is bigger on purpose but when I make it bigger there is empty space on the left side of it and the other smaller blocks don't go there. My question is: How do I get the "5" to go to that empty space and 6 to 5, 7 to 6 etc. How do I get rid of that empty space?
Some code:
CSS:
.block
position: relative
float: left
display: inline
HTML:
<div class='grid'>
<div class='block block-1'><span>1</span></div>
<div class='block block-2'><span>2</span></div>
<div class='block block-1'><span>3</span></div>
<div class='block block-1'><span>4</span></div>
....
</div>
Would I need javascript to do this or is there an HTML/CSS solution?