English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML legend align attribute

The align attribute specifies the alignment of the title within the fieldset.

 HTML <legend> tag

Online Example

Align the title to the right:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <legend> align Attribute Usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<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>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

The "left" and "right" values of the align attribute are supported in all major browsers, but Opera 12and lower versions except. The "bottom" value does not work in all major browsers.

Definition and Usage

HTML5 The <legend> align attribute is not supported in HTML. Please use CSS instead.

In HTML 4.01 In HTML, the align attribute of the <legend> element is deprecated.

The align attribute specifies the alignment of the title within the fieldset.

Syntax

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

Attribute Value

ValueDescription
leftAlign the title to the left (default).
rightAlign the title to the right.
topAlign the title upwards.
bottomAlign the title downwards.
 HTML <legend> tag