7.フレーム
フレームを使うとページを横に分割したり、縦に分割することができます。
このホームページは横に分割してます。
フレームページの仕組みは下のようになってます。
図のように2つに分割する場合3つのhtmlファイルが必要になります。
・フレームを設定する。(上の図で言うとa.html)
下のように書いたファイルを作ります。
cols="20%,80%"のcolsというのは横に20:80の割合で分割することを意味していて、縦に分割するにはrowsにします。
3つ以上分割するにはcols="10%,20%,70%"のようにするだけです。
<html>
<head>
<title>フレーム</title>
</head>
<frameset
cols="20%,80%">
<frame src="b.html">
<frame src="c.html">
</frame>
<html>
|
・余白を指定する。
下のように書くと、b.htmlのページの左右の余白が0に、上下の余白が50になります。
<html>
<head>
<title>フレーム</title>
</head>
<frameset cols="20%,80%">
<frame src="b.html" marginwidth="0"
marginheight="50">
<frame src="c.html">
</frame>
<html>
|
・境界線を設定する。
frameborder="no":境界線を非表示
noresize:境界線を固定
bordercolor:境界線の色指定
<html>
<head>
<title>フレーム</title>
</head>
<frameset cols="20%,80%">
<frame src="b.html" frameborder="no"
noresize bordercolor="blue">
<frame src="c.html">
</frame>
<html>
|
|