JAVAWeb框架

JAVAWeb框架

相对路径、绝对路径

一、什么是框架

	框架将浏览器划分成不同的部分,每一部分加载不同的网页,实现在同一个浏览器窗口中加载多个页面的效果。

二、frameset划分框架标记

1. 语法格式

<frameset>......</frameset>	

2.属性

(1)、cols
	a、使用“像素数”和%分割左右窗口,“*”表示剩余部分
	b、如果使用“*”,“*”表示框架平均分为2个
	c、如果使用“*”,“*”,“*”表示框架被平分为3个
(2)、rows
	使用“像素数”和%分割上下窗口,“*”表示剩余部分
(3)、frameborder
	指定是否显示边框,0不显示,1显示
(4)、border
	设置边框的大小,默认值为5像素

代码块1

<body>
<head>
<frameset cols="25%,25%,50%">
		<frame src="http://www.baidu.com"/>
		<frame src="http://www.jd.com"/>
		<frame src="http://www.taobao.com"/>
</framest>
</head>
</body>

3、子窗口

(1)、<frame>标记是一个单标记,该标记必须放在<frameset>中使用,在<frameset>中设置了几个窗口,就必须对应使用几个<frame>框架,而且还必须使用src属性制定一个网页。
(2)属性
	a、src:加载网页文件的URL地址
	b、name:框架名称,是链接标记的target的所要参数
	c、noresize
		表示不能调整框架大小,没有设置时就可以调整
	d、scrolling
		①是否需要滚动条
		②值
			auto:根据需哟自动出现
			yes:有
			no:无
			e、frameborder
				①是否需要边框
				②值
					1:显示边框
					0:不显示

代码块2.1(left.html)

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>下界面的左界面</title>
</head>
<body>
	<a href="http://www.baidu.om"  target="mainframe">百度</a><br/>
	<a href="http://www.jd.om" target="mainframe">京东</a><br/>
	<a href="http://www.taobao.om" target="mainframe">淘宝</a><br/>
	<a href="reg.html" target="_parent">注册</a><br/>
	<a href="login.html" target="">登陆</a><br/>
</body>

代码块2.2(top.html)

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>主要内容</title>
</head>

代码块2.3(index.html)框架首页

<head>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
	</head>
<frameset rows="20%,*" frameborder="1" border="1">
		<frame src="top.html"/>
		<frameset cols="20%,*">
				<frame src="left.html"/>
				<frame src="main.html"name="mainframe"/>
			</frameset>
</framest>

代码块2.4(reg.html)

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>用户注册</title>
</head>

代码块2.5(login.html)

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>用户登陆</title>
</head>

三、_top与_parent的区别

代码块3.1(text05.html)

<head>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
</head>
<body>
<h1>页面一</h1>
<iframe src="text05_1.html"></iframe><!-----iframe可以放到body里面,也可以放到body外面,而frame只能放在body里面------>
</body>

代码块3.2(text05_1.html)

<head>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>       </title>
</head>
<body>
<h1>页面二</h1>
<iframe src="text05_2.html"></iframe>
</body>

代码块3.3_parent(text05_2.html)

<head>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
</head>
<body>
<h1>页面三<a href="http:\\www.baodu.com" target="_praent"></h1>、

</body>

代码块3.3_top(text05_2.html)

<head>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
</head>
<body>
<h1><a href="http:\\www.baodu.com" target="_top">页面三</h1>、
</body>
四、frame和iframe的区别
1、frame不能脱离frameset单独使用,iframe可以
2、frame不能放在body中,iframe可以
3、iframe是被嵌入在网页的元素,而frame用于组成一个网页的多个框架
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值