legend

Form

<legend> ... </legend>

Attributes

attribute default description
id none specifies the unique ID
class none specifies the style class sheet
style none specifies the style sheet
align left specifies the alignment of the legend

Support

HTML 4.01 [STF], XHTML 1.0 [STF], XHTML 1.1
Microsoft (MSDN)
[IE4 or later][Firefox 1 or later][Safari 1 or later][Opera 6 or later][Netscape 6 or later]

Explanation

The legend tag specifies a caption for input form items grouped by the <fieldset>.

Related Tags

fieldset, form

Sample Code [Output]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
</head>
<body>
<h1>Sample</h1>
<form method="get" action="../bbs.cgi">
<fieldset>
<legend>Your OS</legend>
<input type="checkbox">UNIX
<input type="checkbox">MacOS
<input type="checkbox">Windows
</fieldset>
<fieldset>
<legend>Your Browser</legend>
<input type="checkbox">Firefox
<input type="checkbox">Safari
<input type="checkbox">Opera
<input type="checkbox">Internet Explorer
</fieldset>
</form>
</body>
</html>