<legend align="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
Type

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 aligns to the top (default)
bottom aligns to the 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)

Example


<form method="POST" action="example.cgi">

<fieldset>
<legend align="top">Fieldset legend (Top)</legend>
<p>Name1 : <input type="text" mame="name1" size="30"></p>
</fieldset>

<fieldset>
<legend align="bottom">Fieldset legend (Bottom)</legend>
<p>Name2 : <input type="text" mame="name2" size="30"></p>
</fieldset>

<fieldset>
<legend align="left">Fieldset legend (Left)</legend>
<p>Name3 : <input type="text" mame="name3" size="30"></p>
</fieldset>

<fieldset>
<legend align="right">Fieldset legend (Right)</legend>
<p>Name4 : <input type="text" mame="name4" size="30"></p>
</fieldset>

<fieldset>
<legend align="center">Fieldset legend (Center)</legend>
<p>Name5 : <input type="text" mame="name5" size="30"></p>
</fieldset>

<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</p>

</form>

Output
Fieldset legend (Top)

Name1 :

Fieldset legend (Bottom)

Name2 :

Fieldset legend (Left)

Name3 :

Fieldset legend (Right)

Name4 :

Fieldset legend (Center)

Name5 :

This form cannot submit because of a sample.