}
fieldset > div {
  border: 3px solid orange;
}
.auto {
  height: auto;
}
.min-content {
  height: min-content;
}
.max-content {
  height: max-content;
}
.content-box {
  box-sizing: content-box;
}
.border-box {
  box-sizing: border-box;
}
</style>

<div id="log"></div>

<fieldset class="auto content-box">
  <legend>Legend</legend>
  <div>Contents</div>
</fieldset>
<fieldset class="auto border-box">
  <legend>Legend</legend>
  <div>Contents</div>
</fieldset>
<fieldset class="min-content content-box">
  <le