<!DOCTYPE html>
<html>
  <head>
    <style>
      * { border: 0; margin: 0; padding: 0; }
    </style>
  </head>
  <body>
    <fieldset style="position: relative; top: 25px; left: 20px; width: 100px;">
      <legend>
        <span style="position: absolute; top: 25px; left: 30px">test</span>
      </legend>
    </fieldset>
  </body>
</html>