JSFiddle - React, Tailwind, and code Playground

HTML

<div id="box-cntnr">
  <div class="box" id="b1">box 1</div>
  <div class="box" id="b2">box 2</div>
</div>

CSS

html, body { height: 100%; }

body { margin: 0; }

#box-cntnr {
  display: flex;
  position: relative;
  height: 100%;
  background-color: yellow;
}

.box {
  width: 100px;
  height: 100px;
  background-color: lightblue;
  margin: 10px;
}

#b2 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}