效果如下:
main.html
<html>
<frameset cols="200,*">
<frame src="menu.html">
<frame src="pref.html" name="view_frame">
</frameset>
</html>
menu.html
<html>
<body>
<h3>Table of Contents
</h3>
<ul>
<li><a href="pref.html" target="view_frame">Preface
</a></li>
<li><a href="chap1.html" target="view_frame">Chapter 1
</a></li>
<li><a href="chap2.html" target="view_frame">Chapter 2
</a></li>
<li><a href="chap3.html" target="view_frame">Chapter 3
</a></li>
</ul>
</body>
</html>
pref.html
<html>
<body bgcolor="#ff8888">
<h3>Preface
</h3>
</body>
</html>
余下代码省略,关键是target和name这两个标签的使用。
后面我会在项目中用到这个方法实现菜单导航。
转载请注明原文地址: https://yun.8miu.com/read-119920.html