JSFiddle - React, Tailwind, and code Playground

HTML

<div class='r container'>
  <div class='r red x1'>
    <div class='rel x1'>
      <div class='x1 fit of'>
        Supercalifragilisticexpialidocious
      </div>
    </div>
    <div class='x1'>
      Hello
    </div>
  </div>
  <div class='blue x1'>
  </div>
</div>

CSS

.r {
  display: flex;
}

.container {
  width: 300px;
  height: 50px;
}

.x1 {
  flex: 1 0 0;
}

.of {
  overflow-x: auto;
}

.red {
  background: #f88;
}

.blue {
  background: #88f;
}

.rel {
  position: relative;
}

.fit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}