<!doctype html>
<meta charset="utf-8">
<style>
span {
  display: inline-block;
  width: 20px;
  height: 20px;
}
div {
  line-height: 0;
}
</style>
<div><span style="background-color: #FF00FF"></span><span style="background-color: #00FF00"></span></div>
<div><span style="background-color: #0000FF"></span><span style="background-color: #FF00FF"></span></div>
