当前位置:首页 > 帮助文档库 > HTML > HTML 5
HTML 5 <legend> 标签
来源:网络 作者:佚名 日期:2009-08-26 点击次数

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 实例

围绕数据的 Fieldset
本例演示如何在数据周围绘制一个带标题的框。
本文关键词:
本站文章如果没有注明来源均为www.5ishare.com均为原创,转载请注明出处:我爱分享-文档中心
留言、交流
频道栏目
站内最新
广告支持
本栏目推荐