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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -