首先,建立一个 main.html 用来划分显示导航和内容部分框架,将a.html的内容作为默认显示的内容;
<head>
<title>main</title>
</head>
<frameset cols="120,*">
<frame name="index" src="index.html"/>
<frame name="content" src="a.html"/>
</frameset>
</html>
其次创建导航的html文件和内容部分的html文件;
index.html(作为导航,在这里创建链接,指向内容链接)
<head>
<title>index</title>
</head>
<body>
<a href="a.html" target="content">frame a</a><br/>
<a href="b.html" target="content">frame b</a><br/>
<a href="c.html" target="content">frame c</a>
</body>
a,b,c html(作为被指向的目标)
<head>
<title>a</title>
<style>
body{
background-color:green;
}
h2{ color:grey;
}
</style>
</head>
<body>
<h2>Frame A</h2>
</body>
效果图: