HTML <legend> 标签的 align 属性

定义和用法

align 属性规定 fieldset 中标题的对齐方式。

实例

组合表单中的相关元素:

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

TIY

浏览器支持

所有浏览器都支持 align 属性的 "left" 和 "right" 值,除了 opera。"bottom" 值在所有浏览器中都不起作用。

兼容性注释

在 HTML 4 中,不赞成使用 align 属性;在 XHTML Strict DTD 中,不支持该属性。

语法

<legend align="value">

属性值

值描述
left对标题进行左对齐。
right对标?/td>
top对标题进行上对齐。
bottom对标题进行下对齐。