HTML legend align 属性

HTML legend 标签

对标题进行右对齐:

<form>
	 
	<fieldset>
	   
	<legend align="right">Personalia:</legend>
	   
	Name: <input type="text" size="30"><br>
	   
	Email: <input type="text" size="30"><br>
	   
	Date of birth: <input type="text" size="10">
	 
	</fieldset>
</form>

浏览器支持

除了 Opera,其他主流浏览器都支持 align 属性的 "left" 和 "right" 值。几乎没有主流浏览器支持 "bottom" 值。


定义和用法

HTML5 不支持 <legend> align 属性。请使用 CSS 代替。

在 HTML 4.01 中,<legend> 的 align 属性 已废弃。

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


语法

<legend align="left|right|top|bottom">

属性值

描述
left 对标题进行左对齐(默认)。
right 对标题进行右对齐。
top 对标题进行上对齐。
bottom 对标题进行下对齐。

HTML legend 标签