JSFiddle - React, Tailwind, and code Playground

HTML

<div class="root">
  <div class="container">
    <div class="item">
      <img class="icon"  />
      <!-- <div class="icon"></div> -->
      <span>Hello World !!!</span>
    </div>
  </div>
</div>

CSS

* {
  border: 0px;
  box-sizing: border-box;
  margin: 0px;
  padding: 0px;
}

.root {
  display: flex;
  justify-content: center;
}

.item {
  border: 1px solid black;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.icon {
  background: green;
  width: 16px;
  height: 16px;
  max-width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  width: 50px;
}