JSFiddle - React, Tailwind, and code Playground

HTML

<div id="container">
  <div class="wrapper" style="width: 53%;">
      <div class="white-on-black" style="width: 188.7%;">
           <span>This is a test</span>
      </div>
  </div>
  <div class="black-on-white">
      <span>This is a test</span>
  </div>
</div>

CSS

#container {
    position: relative;
    border: 1px solid;
    text-align: center;
    width: 400px;
    height: 32px;
    line-height: 32px;
}
.black-on-white {
    height: 32px;
    color: #000;
}
.white-on-black {
    height: 32px;
    color: #fff;
    background-color: #44a;
}
.wrapper {
    overflow: hidden;
    position: absolute;
    top: 0; left: 0;
}
.black-on-white {
    width: 100%;
}