<!DOCTYPE html>
<html>

<style type="text/css" media="all">
  .d1 {
    background: red;
    display: inline-block;
    width: 23px;
    height: 23px;
    position: relative;
  }
  .d2 {
    display: inline-block;
    width: 21px;
    height: 21px;
    background: white;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    text-align: center;
  }
</style>

  <body>
    <div class="d1">
      <div class="d2">x</div>
    </div>
  </body>

</html>