JSFiddle - React, Tailwind, and code Playground

by nikgrozev

HTML

<div style="height: 100px; width: 100%;">
<p>Example of three absolute children:</p>

<div id="parent" style="height: 100%; width: 300px; background: yellow; margin: auto;">

  <div id="left">
  </div>

  <div id="right">
  </div>
  
  <div id="content">
    The main content
  </div>

</div>

</div>

CSS

#parent {
  position: relative;
}

#content {
  position: absolute;
  z-index: 1000;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 12px;
}

#left {
  background: red;
  min-width: 30px;
  opacity: 0.8;
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
}

#right {
  background: purple;
  min-width: 30px;
  opacity: 0.8;
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
}