The LEGEND element assigns a caption to a FIELDSET
grouping of form elements. Using a LEGEND is most useful when
pages are rendered using non-visual formats. The ALIGN attribute
of this element will allow horizontal and vertical alignment of
LEGEND content with respect to the FIELDSET in visual browsers.
Note: Use of the LEGEND element is
optional within a FIELDSET, and if used, must immediately follow
the opening FIELDSET tag. If the LEGEND element uses the ACCESSKEY
attribute, the form control within the parent FIELDSET with the
lowest tabbing order receives the focus.
This is a method of giving access/focus to an active HTML element using
a keyboard character. This is a common GUI paradigm also known
as a "keyboard shortcut" or "keyboard accelerator"
A single character is used as the value of this attribute. In addition,
a platform-dependent key is usually used in combination with the
ACCESSKEY character to access the functionality of the active field.
[A single, case-insensitive character from a browser's character set.]
Deprecated in HTML 4.x/XHTML 1.0; Dropped from XHTML 1.1 (use CSS instead)
Specifies the text alignment relative to the FIELDSET.
Values: Top | Bottom |
Left | Right -
Basic alignment values indicated in HTML 4.0 Center - Extra Internet Explorer 4.0 value
for horizontal alignment of content at the top of the LEGEND
Internet Explorer does not allow the TOP and BOTTOM values of the ALIGN
attribute for this element yet. Instead, the LEGEND is always rendered at the
top edge of the FIELDSET, and the LEFT | CENTER | RIGHT alignment values
control positioning along this edge.
In Internet Explorer 4.0 if a LEGEND exists and is NOT the first
element after the opening FIELDSET tag, rendering problems occur. Such a
construct is illegal according to the spec anyway, so don't do it.
Use of the ACCESSKEY attribute for this element in IE 4.0 puts focus on
the first form field within the parent FIELDSET.
In Netscape 6 Beta 1, a black bordered box was automatically placed
around the LEGEND content (equivalent of using <legend STYLE="border:
2px solid black">). In later versions, no border box is applied.
In Netscape 6, the ALIGN attribute horizontally aligns content
relative to the fieldset content, not relative to the fieldset box itself
(IE5 and early Netscape 6 betas align relative to the fieldset box.)