HTML 5 <legend> 標簽
定義和用法
<legend> 標簽為 <fieldset>、<figure> 以及 <details> 元素定義標題。
HTML 4.01 與 HTML 5 之間的差異
在 HTML 4.01 中, <legend> 僅用于 <fieldset> 元素。
在 HTML 5 中, <legend> 標簽應用于 <fieldset>、<figure> 以及 <details> 元素。
在 HTML 5 中,不支持 align 屬性。請使用 CSS 代替。
例子
<fieldset>
<legend>健康信息:</legend>
<form>
<label>身高:<input type="text" /></label>
<label>體重:<input type="text" /></label>
</form>
</fieldset>
屬性
標準屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請訪問 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
如需完整的描述,請訪問 HTML 5 中事件屬性。
TIY 實例
- 圍繞數(shù)據(jù)的 Fieldse