JSFiddle - React, Tailwind, and code Playground

by Kolichikov

HTML

<div class="container">
  <div class="title">
    <p>item1 a really long piece of text that doesn't fit into our container at all</p>
  </div>
  <div>
    <p>item2</p>
  </div>
  <div>
    <p>item3</p>
  </div>
</div>

CSS

p {
  margin: 0;
  padding-left: 1%;
  padding-right: 1%;
  text-align: center;
  max-height: 100%;
}

.title {
  overflow: hidden;
}

.container {
  display: flex;
  border: 1px solid red;
  flex-direction: column;
  height: 150px;
  width: 80px;
}

.container>* {
  flex: 1 1;
  border: 1px solid #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container> :first-child {
  flex: 1 1;
}

.container> :empty {
  flex-grow: 0;
  border: 0px;
  padding: 0px;
}