JSFiddle - React, Tailwind, and code Playground

by Timar

HTML

<div class="pink-label">
  <div class="green-label resize">

    <div class="label-image format o-form resize"> timar is aasdg gways right</div>
    <div class="label-text format o-form">tima   cbdfbdfbfd right </div>
    <div class="label-text2 format o-form"> sdf sdfvsfvsfvsfvsffsdcsdcsdcf </div>
    <div class="non-essential-handle">
    </div>
  </div>
</div>

CSS

.pink-label {
  display: inline-block;
  height: 250px;
  background-color: pink;
  width: 600px;
  margin-left: 100px;
  z-index: -1000000;
}

.green-label {
  height: 75px;
  background-color: lightgreen;
  padding: 10px;
  margin: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 210px;
  position: absolute;
  z-index: 0;
}

.label-image {
  background-color: lightblue;
  display: inline-block;
  white-space: nowrap;
}

.label-text {
  background-color: Green;
  display: inline-block;
  white-space: nowrap;
  transform: translatey(-10px)
}

.label-text2 {
  background-color: teal;
  display: inline-block;
  white-space: nowrap;
    transform: translatey(-10px)
}

.format {
  text-align: center;
  vertical-align: center;
  height: 24px;
  line-height: 24px;
  padding: 0 15px;
  margin: 5px 5px 5px 5px;
}

.resize {
  resize: horizontal;
  overflow: hidden;
}

.non-essential-handle {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: white;
  bottom: 0px;
  right: 0px;
  pointer-events: none;
  z-index: -1;
}