<legend align="">

  • IE
  • Cr
  • Sf
  • Fx

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)


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

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

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

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

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

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

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


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.