Basic example

by Tommy

HTML

<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child -->

<div class="list">
<span class="box red"></span>
<span class="box blue"></span>
<span class="box green"></span>
</div>

CSS

.red {
  background: red;
}
.blue {
  background: blue;
}
.green {
  background: green;
}
.box {
  height: 30px;
  width: 30px;
  display: inline-block;
  margin: 0;
  padding: 0;
}
.list {
  padding: 0;
  display: inline-flex;
}

.list > * {
  margin-left: 10px;
  margin-right: 10px;
}
.list .box:first-child {
  margin-left: 0 !important;
}
.list .box:last-child {
  margin-right: 0 !important;
}