HTML中如何利用frame结构写出导航框架

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>bankuaituijianframe</title>
</head>
<frameset rows="22.5%, 60%" border="0" bordercolor="#eee">">
  <frame src="head.png">
  <frameset cols="3.3%,30%" frameborder="1">
   <frame name='index' src='daohang.html'></frame>
    <frame name='content' src='computer.html'></frame>
</frameset>
<noframes>
  <body>
  本网页使用框架,但你的浏览器不支持,特告知。
  </body>
</noframes>
</html>

其实原理很简单,只是比原来多了一步给frame命名,这样就实现了frame之间的互操作。computer.html是框架名为content的默认页,daohang.html就是左侧的导航栏,位于名为index的框架下,文件如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>daohang</title>
<style type="text/css">
.导航 {
	font-weight: bold;
	color: #003;
}
</style>
</head>
<body>
<table width="116" border="3" bordercolor="#eee">
  <tr>
    <td width="102" class="导航"><span class="导航"><span class="导航"><a href='computer.html' target='content'>计算机类推荐</a></span></span></td>
  </tr>
  <tr>
   <td class="导航"><span class="导航"><a href="child.html" target='content'>儿童类推荐</a></span></td>
  </tr>
  <tr>
   <td class="导航"><span class="导航"><a href="art.html" target='content'>艺术类推荐</a></span></td>
  </tr>
  <tr>
    <td class="导航"><span class="导航"><a href="index.html">返回首页</a></span></td>
  </tr>
</table>
</body>
</html>

来图纪念!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值