css - Divs of varying size don't float correctly -


if float:left bunch of divs same dimensions, seems work well, example: divs floating

however, if 1 of divs taller others, first div float left of , rest pushed right. can reproduce increasing height of divtwo in example:

div.divone{   width:100px;   height:100px;   background-color: red;   border-style: solid;   border-color: blue;   float: left; }  div.divtwo{   width:100px;   height:250px;   background-color: green;   border-style: solid;   border-color: blue;   float: left; }  <div class="divone">abc</div> <div class="divtwo">abc</div> <div class="divone">abc</div> <div class="divone">abc</div> <div class="divone">abc</div> <div class="divone">abc</div> 

an image of 2 examples side side arrow pointing i'm expecting divs go

what should small divs fit in empty space left of tall div?

sounds looking masonary type layouts. here's blog post.

https://medium.com/@_jh3y/how-to-pure-css-masonry-layouts-a8ede07ba31a#.64f1qm9a


Comments

Popular posts from this blog

php - isset function not working properly -

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -