I have several divs in the wrapper, they have different heights. I would like to swim to the left. 2 Divs can fit in a row. But since each div has a different height, a rather strange space remains in the next line. Is it possible to remove the space and move the div up?
Please see the image:
Here is the code:
<div class="wrap">
<div class="box1">Box1 with less height.</div>
<div class="box2">Box2 with more height.</div>
<div class="box3">Box3 with whatever height.</div>
</div>
CSS
.wrap{
width:410px;
border:1px solid red;
overflow:hidden;
}
.box1{
width:200px;
height:50px;
float:left;
border:1px solid green;
}
.box2{
width:200px;
height:150px;
float:left;
border:1px solid blue;
}
.box3{
width:200px;
height:250px;
float:left;
border:1px solid blue;
}
JSFiddle:
http://jsfiddle.net/NsH5M/
PS. The height of the div is not fixed. This is just for example.
Edit: Sorry, I should have mentioned that it cannot be edited with markup.

source
share