
<html>
<head>
<title> .... </title>
</head>
<frameset>
คำสั่ง
</frameset>
</html>จะเห็นว่า file นี้จะไม่มี <body> แต่จะมี <frameset> ขึ้นมาแทน เพราะว่าคำสั่งแบ่งหน้าจอนี้ จะใช้กำหนดเพื่อให้แสดงหน้าอื่นเท่านั้น
การแบ่งหน้าจอตามแนวตั้ง
<html>
<head>
<title> .... </title>
</head>
<frameset cols="L%,R%">
<frame src="URL ของ frame ด้านซ้าย" name="ชื่อของ frame">
<frame src="URL ของ frame ด้านขวา" name="ชื่อของ frame">
</frameset>
</html>การแบ่ง frame ตามแนวตั้งคือการแบ่งแบบมีด้านซ้าย และด้านขวา โดยขนาดของ frame ด้านซ้ายกำหนดได้โดย กำหนดค่าลงบนตัวแปร L ควรมีหน่วยเป็น % เพื่อที่คนที่ใช้หน้าจอ ความละเอียดไม่เท่าเรา จะสามารถดูได้ และใส่ขนาดของ frame ด้านขวาในตัวแปร R เช่นเดียวกับ ตัวแปร L
การแบ่งหน้าจอตามแนวนอน
<html>
<head>
<title> .... </title>
</head>
<frameset rows="T%,B%">
<frame src="URL ของ frame ด้านบน">
<frame src="URL ของ frame ด้านล่าง">
</frameset>
</html>การแบ่งจอตามแนวนอน สามารถทำได้เช่นเดียวกับ แนวตั้ง โดยการเปลี่ยน cols เป็น rows
การแบ่ง frame หลาย frame ซ้อนกัน
<html>
<head>
<title> .... </title>
</head>
<frameset rows="30%,50%,20%">
<frame src="http://www.yahoo.com">
<frameset cols="50%,50%">
<frame src="http://www.excite.com">
<frame src="http://www.hotmail.com">
</frameset>
<frame src="http://www.rocketmail.com">
</frameset>
</html>การแบ่งหลายๆ frame ซ้อนกัน ก็ใช้ชุดคำสั่งเดียวกันกับคำสั่งแบ่ง frame ธรรมดา แต่นำคำสั่งมาซ้อนกัน ดังตัวอย่างด้านบน
ผลที่ได้ Example27.html
การกำหนด scroll bar ให้ frame
<html>
<head>
<title> .... </title>
</head>
<frameset rows="30%,50%,20%">
<frame src="http://www.yahoo.com" scrolling="no">
<frameset cols="50%,50%">
<frame src="http://www.excite.com" scrolling="yes">
<frame src="http://www.hotmail.com" scrolling="auto">
</frameset>
<frame src="http://www.rocketmail.com" scrolling="no">
</frameset>
</html>no = ไม่มี scroll bar
yes = มี scroll bar
auto = แล้วแต่ browser
ผลที่ได้ Example28.html
การกำหนด frame ที่ต้องการให้แสดงข้อมูล
<a href="URL" target="ชื่อของ frame นั้น(name)">textlink</a> ตามปกติ เราสามารถใช้คำสั่ง <a href......> เหมือนที่เคยกล่าวไว้แล้ว ซึ่งเมื่อเรา click ข้อความ(textlink) ที่ตามหลังคำสั่ง <a href....>ก็จะสามารถ link ไปยัง URL ที่ต้องการได้ แต่ในกรณีที่ homepage ของเรามีหลาย frame เราสามารถกำหนดให้ แสดงผลการ link ไปที่ frame ใด frame หนึ่งได้ โดยการเพิ่มคำสั่ง target ดังตัวอย่าง ชื่อของ frame ก็จะต้องกำหนดไว้ก่อนดังที่แสดงในตัวอย่างในหัวข้อ การแบ่งหน้าจอ ตามแนวตั้ง(ด้านบน) หากตัองการให้แสดงผลเต็มหน้าจอ(ออกจาก frame) ให้ใช้คำสั่ง <a href="URL" target="_top">
![]()