HTML <legend> tag
Definition and Usage
The legend element defines a caption for a fieldset.
Differences Between HTML and XHTML
The align attribute was deprecated in HTML 4.01.
The align attribute is not supported in XHTML 1.0 Strict DTD.
Example
Optional Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| align |
top
bottom
left
right |
Defines the alignment for contents in the fieldset. Top is
default |
TF |
Standard Attributes
| id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
| accesskey, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event
Attributes.
Try-It-Yourself Demos
Fieldset around
data
How to draw a border with a caption around your data.
|