HTML:
<div id='container'>
<span class='box'>Content</span>
<span class='box'>Content</span>
<span class='box'>Content</span>
<span class='box'>Content</span>
</div>
CSS:
#container {
width: 960px;
height: 960px;
background-color: #ccc;
}
.box {
width: 300px;
height: 300px;
background-color: blue;
display: inline-block;
}
Result: https://jsfiddle.net/58fmcabz/
When I use table-cell
in the display property the gaps disappear. I tried removing margin and padding using the .box
class to no avail. Why are the gaps there?