legend

FilterElements

<legend> ... </legend>

Assigns a caption to a fieldset (it must be the first child of a fieldset element). This improves accessibility when the fieldset is rendered nonvisually.

Start/End Tags

Required/Required

Specifications

  • HTML 4.01
  • HTML5

accesskey=

Values: character
Assigns an access key (keyboard shortcut) to an element for quicker access.

align=

Values: top | bottom | left | right
Deprecated. Not in HTML5. Aligns the text relative to the fieldset.
<fieldset>
<legend>Mailing List Sign-up</legend>
<ul>
  <li><label>Add me to your mailing list
  <input type="radio" name="list" value="yes"></label></li>
  <li><label>No thanks <input type="radio" name="list" value="no">
   </label></li>
</ul>
</fieldset>

Rendered Example

Mailing List Sign-up
      
  •   

A 1-pixel border was added with a style rule to make the fieldset area evident.