JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

HTML

<div class='box'>
  <div class='col relative'>
    relative
    <div class='child'>
      child of relative
    </div>
  </div>
  <div class='col'>
    not relative
    <div class='child'>
      child of not relative
    </div>
  </div>
</div>

SCSS

html, body {
  height: 100%;
  margin: 0;
  font-family: sans-serif;
}
body {
  background: #eee;
}
.box {
  display: flex;
  height: 100%;
  padding: 50px;
  box-sizing: border-box;
}

.col {
  flex: 1;
  border: 1px solid #ccc;
  background: white;
  padding: 30px;
  box-sizing: border-box;
}

.relative {
  position: relative;
}

.child {
  padding: 50px;
  box-sizing: border-box;
  position: absolute;
  border-radius: 5px;
  top: 0;
  right: 0;
  background: white;
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.2);
}