HTML学习3--框架网页

 1.框架的基本概念:http://www.w3school.com.cn/

 

2.框架的基本结构:

 

注意事项:1.框架网页是没有body的!!!!

 

 
 
  1. <html> 
  2. <head> 
  3.     <meta http-equiv="Content-Type" content="text/html;charset=GBK" /> 
  4.     <title>框架网页-cols</title> 
  5. </head> 
  6.     <frameset rows="80,*" border="5"> 
  7.         <frame name="top" src="top.html"/> 
  8.         <frameset cols="400,*"> 
  9.             <frame name="left" src="http://www.baidu.com"/> 
  10.             <frame name="right" src="http://www.google.com.hk"/> 
  11.         </frameset> 
  12.     </frameset> 
  13. </html> 

注意事项:如果你想让框架网页之间的边框消失,要在frame标签中加上frameborder="0"这个属性!!


如果你不想框架网页之间的边框可以被随意拖动,那么你需要再frame标签中加上noresize="noresize"这个属性!

 

eg.

 
 
  1. <html> 
  2. <head> 
  3.     <meta http-equiv="Content-Type" content="text/html;charset=GBK" /> 
  4.     <title>框架网页-cols</title> 
  5. </head> 
  6.     <frameset rows="80,*" border="5"> 
  7.         <frame name="top" src="http://www.sina.com" frameborder="0"/> 
  8.         <frameset cols="400,*"> 
  9.             <frame name="left" src="http://www.baidu.com" frameborder="0"/> 
  10.             <frame name="right" src="http://www.w3school.com.cn/" frameborder="0" noresize="noresize"/> 
  11.         </frameset> 
  12.     </frameset> 
  13. </html> 

3.框架网页中的超链接:

 

target="blank" → 新窗口


target="parent" → 父窗口


target="right" → 去框架中的某个name="right"的窗口。当然,还可以有left,top等。

 

3.当你想在普通网页中引入其他的网页时,可以用iframe这个标签!

用法:

 

 
 
  1. <html xmlns="http://www.w3.org/1999/xhtml"> 
  2. <head> 
  3.     <meta http-equiv="Content-Type" content="text/html;charset=GBK" /> 
  4.     <title>iframe</title> 
  5. </head> 
  6. <body> 
  7.     <iframe src="http://www.baidu.com" frameborder="2" width="200" height="200" scrolling="no"/> 
  8. </html> 

它的一些属性:

 

 

 



     本文转自韩立伟 51CTO博客,原文链接:http://blog.51cto.com/hanchaohan/927271,如需转载请自行联系原作者








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值