html表单——使用frameset写一个导航栏效果

主页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<!--frameset   
		说明:1、frameset不能潜入在body标签里面,只能嵌入在html标签里面-
			 2、一个html页面中不能同时嵌入多个frameset标签
			 3、若有多个frame标签,且同时未设置src属性值,则设置任何一个src属性,其他src属性也默认为该属性
	->
<!--	<frameset cols="200px,20%,*">
		<frame src="#"/><frame src="#"/><frame src="#"/>
	</frameset>-->
	
	<!--
		frameborder="0“ :用来设置不显示分隔条
		noresize="noresize"   :则设置分隔条不可拖动
		scrolling="no"    :不显示滚动条     (要么所有的frame都设置scrolling属性,要么最后一个frame标签设置scrolling属性)
	-->
<!--	<frameset rows="200px,20%,*" frameborder="1" noresize="noresize"  >		
		<frame src="http://dict.youdao.com/w/Frame/#keyfrom=dict2.top" />
		<frame src="http://dict.youdao.com/w/Frame/#keyfrom=dict2.top"  scrolling="no"/>
		<frame src="http://dict.youdao.com/w/Frame/#keyfrom=dict2.top" />
	</frameset>-->
	
	<!--左边是页面导航栏,右边是导航栏对应的内容-->
	<frameset cols="200px,*" frameborder="1" noresize="noresize"  >		
		<frame src="navigationbar.html" />
		<frame src="http://www.baidu.com" name="bodyContent"/>
	</frameset>
</html>

  

导航页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>navigationbar.html</title>
	</head>
	<body>
		<a href="http://www.baidu.com" target="bodyContent" >百度</a><br/><br/>
		<a href="http://www.sina.com.cn/" target="bodyContent" >新浪</a><br/><br/>
		<a href="http://dict.youdao.com/" target="bodyContent" >有道词典</a><br/><br/>
		<a href="https://ssl.zc.qq.com/chs/index.html?type=1" target="bodyContent" >QQ邮箱注册</a><br/><br/>
	</body>
	
</html>

  

转载于:https://www.cnblogs.com/1020182600HENG/p/6832608.html

当然可以,以下是一个使用 frameset 和 frame 的示例 HTML 文件: ```html <!DOCTYPE html> <html> <head> <title>Frameset and Frame Example</title> </head> <body> <!-- 定义 frameset --> <frameset cols="30%, 70%"> <!-- 定义左边的 frame --> <frame src="left.html" name="left"> <!-- 定义右边的 frame --> <frame src="right.html" name="right"> </frameset> </body> </html> ``` 在上述示例中,我们定义了一个 `frameset`,该 `frameset` 包含两个 `frame`,分别是左边的 `frame` 和右边的 `frame`。 我们可以通过 `cols` 属性指定 `frameset` 中每个 `frame` 的列宽百分比。在本例中,左边的 `frame` 宽度为 `30%`,右边的 `frame` 宽度为 `70%`。 接下来,我们可以在 `src` 属性中定义左边和右边的 `frame` 要加载的 HTML 文件。在本例中,分别是 `left.html` 和 `right.html`。 例如,我们可以创建两个简单的 HTML 文件 `left.html` 和 `right.html`,如下所示: ```html <!-- left.html --> <!DOCTYPE html> <html> <head> <title>Left Frame</title> </head> <body> <h1>This is the left frame</h1> <p>Hello World!</p> </body> </html> <!-- right.html --> <!DOCTYPE html> <html> <head> <title>Right Frame</title> </head> <body> <h1>This is the right frame</h1> <p>Welcome to my website!</p> </body> </html> ``` 现在,当我们在浏览器中打开上面的 HTML 文件时,会看到一个包含左边和右边 `frame` 的页面。左边的 `frame` 中会显示 "This is the left frame" 和 "Hello World!",右边的 `frame` 中会显示 "This is the right frame" 和 "Welcome to my website!"。 希望这可以帮助你理解如何使用 `frameset` 和 `frame` 创建多个 HTML 页面的布局。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值