<p>Reduce the box' height by moving the handle</p>
<div>
  <span>Gimme space!</span>
</div>
html {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: rebeccapurple;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2rem;
}
div {
  width: 10em;
  inline-size: 10em; /* logical axis */
  height: 2em;
  block-size: 2em; /* logical axis */
  border: 0.1em solid cyan;
  resize: vertical;
  resize: block; /* logical axis */
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  overflow: hidden;
}
div::before {
  content: "";
  width: 100%;
  inline-size: 100%; /* logical axis */
}
span {
  height: 2em;
  block-size: 2em; /* logical axis */
  line-height: 2;
  padding: 0 0.5em;
  background: #000a;
  text-align: center;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.