HTML Form How to - Place legend positioned inside fieldset


We would like to know how to place legend positioned inside fieldset.


<!DOCTYPE html>
<style type='text/css'>
fieldset {<!-- w  ww.  j a  v  a 2 s  . c om-->
  border: 0;
  background: #ffccaa;
  margin: 20px auto;
  width: 50%;
  position: relative;
  padding: 50px 20px 20px;

legend {
  font-weight: bold;
  position: absolute;
  top: 20px;
  left: 18px;
    <legend>I'm a legend</legend>
    fieldset content

The code above is rendered as follows: