<style>
.container {
  width: 50px;
  height: 50px;
  background-color: cyan;
}

.float {
  width: 50px;
  height: 10px;
  background-color: green;
}

img {
  width: 10px;
  height: 20px;
  background-color: blue;
  position: relative;
}
</style>
<div class=container><div class=float></div><img style="top: -10px;"></div>
<div class=container><div class=float></div><img style="top: -10px; left: 40px"></div>
<div class=container><div class=float></div><img></div>
<div class=container><div style="float: right" class=float></div><img style="left: -50px;"></div>
<div class=container><div style="float: right" class=float></div><img style="top: -10px; left: -10px;"></div>
<div class=container><div style="float: right" class=float></div><img></div>
