<!doctype html>
<title>Reference for legend block margins</title>
<style>
body { margin: 0; }
.fieldset { margin: 2em 1em 1em 1em; border: 1em solid green; }
.legend { position: absolute; margin-top: -1em; margin-left: 1em; background: white; height: 1em; }
.inner { margin: 3em 1em 1em 1em; height: 1em; }
</style>
<p>There should be no red.</p>
<div class=fieldset>
  <div class=legend>X</div>
  <div class=inner>Y</div>
</div>
