html - CSS different height div elements causing grid spacing -


this picture describes problem better can put words. how can grid tight without gaps. need css solution if there one. rather not change html if @ possible. there demo set here if try out ideas. variable heights must allowed can't set elements same height. ideas?

demo

enter image description here

you can alternating floats. changed of box css, adding box-sizing , removing inline-block

http://jsfiddle.net/x666e/

.box{background-color:white;   border:1px solid black;   margin: 0;   width:50%;   display:block;   float:left;   box-sizing: border-box; } .box:nth-child(2n + 0) { float: right; } 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -