JSFiddle - React, Tailwind, and code Playground

HTML

<fieldset>
<legend>Legend</legend>
<div>No red background should be visible.</div>
</fieldset>

CSS

fieldset {
  width: 200px;
  height: 200px;
  position: relative;
  background: red;
}

div {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: green;
}