legend
部品グループのラベル
<legend></legend>
フォーム部品のグループにラベルを付ける要素です。
この要素は、fieldset要素内で使用します。
<form method="post" action="example.cgi">
<fieldset>
<legend>申込者</legend>
<p>お名前:<input type="text" name="name1" size="30"></p>
<p>ご住所:<input type="text" name="address1" size="50"></p>
</fieldset>
<fieldset>
<legend>お届け先</legend>
<p>お名前:<input type="text" name="name2" size="30"></p>
<p>ご住所:<input type="text" name="address2" size="50"></p>
</fieldset>
<p><input type="submit" value="送信する"></p>
</form>
| 属性 | 説明 | 値 | 説明 |
|---|---|---|---|
| 非推奨属性 | |||
| align | ラベルの位置指定 | top | グループの上 (初期値) |
| bottom | グループの下 | ||
| left | グループの左 | ||
| right | グループの右 | ||
- 共通属性・その他属性
- style
- class
- id
- title
- lang
- dir
- accesskey
- イベント属性
- onclick
- ondblclick
- onmousedown
- onmouseup
- onmouseover
- onmousemove
- onmouseout
- onkeypress
- onkeydown
- onkeyup
- HTML5で廃止された属性
- align
<legend accesskey="u">申込者(U)</legend>
DTD
| Str | Tra | Fra |
|---|---|---|
| ○ | ○ | ○ |
タグ
| 開始タグ | 終了タグ |
|---|---|
| 必須 | 必須 |
分類
- fieldset要素の子要素
子要素
- インライン要素
- 文字列
メモ
この要素は、fieldset要素内の最初の部分(fieldset開始タグの直後)に配置します。
一般的なブラウザでは、グループの左上にラベルが表示されます。