当前位置:首页 > HTML5教程 > HTML5技巧

HTML <legend> 标签

html <legend> 标签

  • <label>

实例

组合表单中的相关元素:

<form>
  <fieldset>
    <legend>health information</legend>
    height: <input type="text" />
    weight: <input type="text" />
  </fieldset>
</form>

亲自试一试

浏览器支持

元素 chrome ie firefox safari opera
<legend> yes yes yes yes yes

所有浏览器都支持 <legend> 标签。

定义和用法

legend 元素为 fieldset 元素定义标题(caption)。

html 与 xhtml 之间的差异

在 html 4.01 中,align 属性不被赞成使用。

在 xhtml 1.0 strict dtd 中,align 属性不被支持。

可选的属性

dtd 指示此属性允许在哪种 dtd 中使用。s=strict, t=transitional, f=frameset.

属性 值 描述 dtd
align
  • top
  • bottom
  • left
  • right

不赞成使用。请使用样式代替。

为 fieldset 中的标题定义对齐方式。

tf

全局属性

<fieldset> 标签支持 html 中的全局属性。

事件属性

<fieldset> 标签支持 html 中的事件属性。

tiy 实例

围绕数据的 fieldset 本例演示如何在数据周围绘制一个带标题的框。

相关页面

html dom 参考手册:legend 对象

  • <label>

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!