I've got divs of equal widths but variable heights, however the divs in the code below have vertical white space between them (div49 in particular), how can I get the divs to align at the top of the page and fill in underneath each other vertically as well as horizontally (basically removing as much white space as possible between divs)?
Looking for a pure CSS solution if one exists?
.boxx {
border-radius: 5px;
border: 5px solid #AACAF7;
padding: 10px;
background-color: #eee;
width: 200px;
height: 60px;
position: relative;
overflow: hidden;
display: inline-block;
/* float: left;*/
}
.boxx2 {
border-radius: 5px;
border: 5px solid #AACAF7;
padding: 10px;
background-color: #eee;
width: 200px;
height: 120px;
position: relative;
overflow: hidden;
display: inline-block;
/* float: left;*/
}
<div id="sortableDiv">
<div class="boxx2" data-sort='5.1'>div5.1</div>
<div class="boxx" data-sort='49'>div49</div>
<div class="boxx2" data-sort='1.1'>div1.1</div>
<div class="boxx" data-sort='2'>div2</div>
<div class="boxx" data-sort='1'>div1</div>
<div class="boxx" data-sort='3'>div3</div>
<div class="boxx" data-sort='99'>div99</div>
<div class="boxx" data-sort='88'>div88</div>
<div class="boxx" data-sort='77'>div77</div>