legend

書式

<legend>〜</legend>

属性

属性名 初期値 内 容
id なし IDを指定します。
class なし スタイルシートクラスを指定します。
style なし スタイルシートを指定します。
align left 表示位置を指定します。

対応

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

説明

<fieldset>でグループ化された入力フォームの項目のグループ名を指定します。

関連タグ

fieldset, form

サンプルコード [実行]

<!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>使用OS</legend>
<input type="checkbox">UNIX
<input type="checkbox">MacOS
<input type="checkbox">Windows
</fieldset>
<fieldset>
<legend>使用ブラウザ</legend>
<input type="checkbox">Firefox
<input type="checkbox">Safari
<input type="checkbox">Opera
<input type="checkbox">Internet Explorer
</fieldset>
</form>
</body>
</html>