[新着] Webテンプレートを仮オープンしました
frameタグに name="" を追加すると、そのフレームに対してフレーム名を付けることができます。
<frame src="example.html" name="test">
| name="" | 任意のフレーム名を指定します |
|---|
※フレーム名には、アルファベットで始まる半角英数字(一部の記号も使用可)で好きな名前を指定できます。
※フレーム名に使用できる記号は、ハイフン( - )、アンダーバー( _ )、コロン( : )、ピリオド( . )の4つです。
このフレーム名は、リンクにtarget属性を指定する場合や、formの送信でtarget属性を指定する場合などに使用されます。
■上下に3分割した画面で、上から順に top、middle、bottom というフレーム名を付ける場合
<html>
<head>
<title>フレームサンプル</title>
</head>
<frameset rows="100,100,*">
<frame src="example05a.html" name="top">
<frame src="example05b.html" name="middle">
<frame src="example05c.html" name="bottom">
<noframes>
<body>
<p>ここにフレーム未対応ブラウザ向けの内容</p>
</body>
</noframes>
</frameset>
</html>
この例では、一番上に表示されるページ(sample05a.html)にリンクボタンを配置して、その表示先を middle と bottom に指定しています。
<a href="example05d.html" target="middle">middleフレームに表示する</a>
<a href="example05d.html" target="bottom">bottomフレームに表示する</a>
▼これをブラウザで見ると次のように表示されます