The align attribute of the LEGEND element specifies the alignment of the fieldset caption.
<legend align="right">fieldset legend</legend>
| Attribute | Value | Explanation |
|---|---|---|
| align=" " | top | - |
| bottom | - | |
| left | aligns to the left | |
| right | aligns to the right | |
| center | aligns to the center (Extension) |
The use of this attribute is deprecated. (Use CSS instead)
<form method="POST" action="example.cgi"> <fieldset> <legend align="left">Fieldset legend (Left)</legend> <p>Name1 : <input type="text" mame="name1" size="30"></p> </fieldset> <fieldset> <legend align="right">Fieldset legend (Right)</legend> <p>Name2 : <input type="text" mame="name2" size="30"></p> </fieldset> <fieldset> <legend align="center">Fieldset legend (Center)</legend> <p>Name3 : <input type="text" mame="name3" size="30"></p> </fieldset> <p> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </p> </form>
This form cannot submit because of a sample.