HTML 5 <fieldset> 標(biāo)簽
定義和用法
fieldset 元素可將表單內(nèi)的相關(guān)元素分組。
<fieldset> 標(biāo)簽將表單內(nèi)容的一部分打包,生成一組相關(guān)表單的字段。<fieldset> 標(biāo)簽沒(méi)有必需的或唯一的屬性。
當(dāng)一組表單元素放到 <fieldset> 標(biāo)簽內(nèi)時(shí),瀏覽器會(huì)以特殊方式來(lái)顯示它們,它們可能有特殊的邊界、3D 效果,或者甚至可創(chuàng)建一個(gè)子表單來(lái)處理這些元素。
HTML 4.01 與 HTML 5 之間的差異
在 HTML 5 中有一些新屬性,同時(shí)不再支持 HTML 4.01 中的一些屬性。
屬性
屬性 | 值 | 描述 | 4 | 5 |
---|---|---|---|---|
disabled | true | false | 定義 fieldset 是否可見(jiàn)。 | ? | 5 |
form | true | false | 定義該 fieldset 所屬的一個(gè)或多個(gè)表單。 | ? | 5 |
標(biāo)準(zhǔn)屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請(qǐng)?jiān)L HTML 5 中標(biāo)準(zhǔn)屬性。
事件屬性
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
如需完整的描述,請(qǐng)?jiān)L HTML 5 中事件屬性。
TIY 實(shí)例
- 圍繞數(shù)據(jù)的 Fieldset
- 本例演示如何在數(shù)據(jù)周?chē)L制一個(gè)帶標(biāo)題的框。