I have set up 4 divs all of width: 120px placed inside of a wrapper of 240px wide.
JSFiddle here - http://jsfiddle.net/s7dxxro0/1/
HTML:
<div id="wrapper">
<div class="primary-content-block" id="about">
</div>
<div class="primary-content-block" id="gallery">
</div>
<div class="primary-content-block" id="contact">
</div>
<div class="primary-content-block" id="news">
</div>
</div>
CSS:
#wrapper {
margin:0 auto;
width: 240px;
}
.primary-content-block {
display:inline-block;
vertical-align:top;
width: 120px;
height: 120px;
}
#about {
background: radial-gradient(#5cc4ba, #00aa99);
}
#gallery {
background: radial-gradient(#5cc4ba, #00aa99);
}
#contact {
background: radial-gradient(#5cc4ba, #00aa99);
}
#news {
background: radial-gradient(#5cc4ba, #00aa99);
}
However the elements to not display next to each other due to a slight margin being applied to my 4 blocks.
Where does this what seems to be a margin come from? How do I remove it?
This works when I use float:left in place of display:inline-block but I would prefer not to use floats for many reasons