From http://www.w3schools.com (Copyright Refsnes Data)
The legend element defines a caption for the <fieldset>, <figure>, and the <details> elements.
In HTML 4.01 the <legend> tag only applied to the <fieldset> element.
In HTML 5 the <legend> tag applies to the elements: <fieldset>, <figure>, and <details>
The align attribute is no longer supported in HTML 5. Use CSS instead.
| Source | Output |
|---|---|
| <fieldset> <legend>Health information:</legend> Height <input type="text" size="3" /> Weight <input type="text" size="3" /> </fieldset> |
| Attribute | Value | Description | 4 | 5 |
|---|---|---|---|---|
| align | top bottom left right |
Defines the alignment for contents in the fieldset. Top is default. Not supported. Use CSS to align elements. | 4 |
| class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard Attributes in HTML 5.
| onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload |
For a full description, go to Event Attributes in HTML 5.
Fieldset around
data
How to draw a border with a caption around your data.
From http://www.w3schools.com (Copyright Refsnes Data)