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?
you can alternating floats. changed of box css, adding box-sizing , removing inline-block
.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
Post a Comment