I usually set font-size of the parent container to zero, which makes white spaces causing gaps to disappear. You then just need to set font-size back to necessary value for spans, for example:
.container {
font-size: 0; // whitespaces go away
}
.container span {
font-size: 16px; // spans text please stay
background: #DDD;
padding: 2px 4px;
}
Demo: http://jsfiddle.net/we9bvrpe/