This is a variation of the discussion on removing right and left border space in table-cell display elements.
Despite attempting to use divs with equal inner margins, I encountered unexpected spacing causing the last div to wrap.
You can view my attempt at a solution here: https://jsfiddle.net/kyy7qgLz/1/
* {
margin: 0;
padding: 0;
border: 0;
}
#container {
width: 100%;
background-color: blue;
}
.item {
margin-left: 4%;
width: 22%;
display: inline-block;
background-color: red;
}
.item:first-of-type {
margin-left: 0%;
}
<div id="container">
<div class="item">
Text 1
</div>
<div class="item">
Text 2
</div>
<div class="item">
Text 3
</div>
<div class="item">
Text 4
</div>
</div>
I am seeking insights on the source of the extra spacing issue and how to eliminate it. Can anyone provide guidance?