HTML <legend> 標(biāo)簽
定義和用法
legend 元素為 fieldset 元素定義標(biāo)題(caption)。
實(shí)例
組合表單中的相關(guān)元素:
<form> <fieldset> <legend>health information</legend>
height: <input type="text" /> weight: <input type="text" /> </fieldset> </form>
TIY
HTML 與 XHTML 之間的差異
在 HTML 4.01 中,align 屬性不被贊成使用。
在 XHTML 1.0 Strict DTD 中,align 屬性不被支持。
可選的屬性
DTD 指示此屬性允許在哪種 DTD 中使用。S=Strict, T=Transitional, F=Frameset.
屬性 | 值 | 描述 | DTD |
---|---|---|---|
align |
| 不贊成使用。請(qǐng)使用樣式代替。 為 fieldset 中的標(biāo)題定義對(duì)齊方式。 | TF |
標(biāo)準(zhǔn)屬性
id, class, title, style, dir, lang, xml:lang
如需完整的描述,請(qǐng)?jiān)L問(wèn)標(biāo)準(zhǔn)屬性。
事件屬性
accesskey, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
如需完整的描述,請(qǐng)?jiān)L問(wèn)事件屬性。
TIY 實(shí)例
- 圍繞數(shù)據(jù)的 Fieldset
- 本例演示如何在數(shù)據(jù)周?chē)L制一個(gè)帶標(biāo)題的框。