How can I arrange elements with different heights vertically? I mean using something like this:
div[class^="elm"]{
width: 50%;
display: inline-block;
margin-bottom: 20px;
background-color: gray;
}
.elm1{
height: 100px;
}
.elm2{
height: 200px;
}
.elm3{
height: 160px;
}
.elm4{
height: 110px;
}
.elm5{
height: 60px;
}
.elm6{
height: 220px;
}
.elm7{
height: 90px;
}
<div class="elm1">Element 1</div><div class="elm2">Element 2</div><div class="elm3">Element 3</div><div class="elm4">Element 4</div><div class="elm5">Element 5</div><div class="elm6">Element 6</div><div class="elm7">Element 7</div>
and showing it like this (ordering is important):
I know this type of thing can happening with two blocks. each for one column but it makes me to use javascript in responsive design (for making it more than two columns).
Example Google+ doing it with multi block that changes by javascript. How can I do it without using javascript and only CSS?