1. Home
  2. Computing & Technology
  3. Web Design / HTML

<legend></legend>

By , About.com Guide

<legend> Description:

The <legend></legend> element assigns a caption to fieldsets within forms.

<legend> Web Browser Support:
<legend> Attributes:
<legend> End Tag:
</legend> REQUIRED
<legend> Contents:

Text. The following tags are valid within the <legend> tag:
a, abbr, acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input, kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, sup, textarea, tt, u, var

<legend> Valid Context:

The <legend> tag is valid within the following tags:
fieldset

<legend> Usage:
  • Standard <legend>
    <form>
    <fieldset>
    <legend align="right">Name</legend>
    <legend align="left">Required Field</legend>
    <label for="firstname">
    First Name:
    <input name="firstname" id="firstname">
    </label>
    <legend align="left">Non-required Field</legend>
    <label for="lastname">
    Last Name:
    <input name="lastname" id="lastname">
    </label>
    </fieldset>
    </form>
<legend> Special Notes:
  • Use the legend field to make your forms accessible, especially when they are not rendered in a graphical manner.
More <legend> Information:

Return to XHTML Element (HTML Tags) Library

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.