iframe和frameset

  Frame与Iframe两者可以实现的功能基本相同,不过Iframe比Frame具有更多的灵活性。

  Iframe标记又叫浮动帧标记,可以用它将一个HTML文档嵌入在一个HTML中显示。它和Frame标记的最大区别是在网页中嵌入的<Iframe></Iframe>所包含的内容与整个页面是一个整体,而<Frame></Frame>所包含的内容是一个独立的个体,是可以独立显示的。另外,应用Iframe还可以在同一个页面中多次显示同一内容,而不必重复这段内容的代码。

  

1. <iframe> 标签:iframe 是个内联框架,是在页面里生成个内部框架。<!--独自生成的拥有frame的全部功能!-->

2. <frameset> 标签:frameset 定义一个框架集,包含多个子框架,每个框架都有独立的文档。

  frameset:

  

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>First</title>
    </head>
  
        <frameset rows="10%,90%">
            <frame src="Top.html" name="top"/>
            <frameset cols="15%,*">
                    <frame src="Home.html" name="home"/><!--home.html(a标签) 里面指定target指向-->
                        <frame src="index1.html" name="index1"/>
                        
            </frameset>
        
            <noframes>
                <body>
                你的浏览器不支持frame
                </body>
            </noframes>
            
        </frameset>
    </html>

  frameset属性:

  rows:"行数"

  cols:"列数"

  frameborder:"yes/no/0/1"

  frame属性:

  src:链接的url

  id:名称

  name:名称

  scrolling:是否滚动(yes/no/auto)

  noresize:"noresize" 防止鼠标调整框架大小

 

posted @ 2017-03-16 11:11  lgq123  阅读(188)  评论(0编辑  收藏  举报
(function(){ function fixAnchor(anchor){ if(anchor){ if(anchor.pathname.indexOf("/echofool/")==0){ var url="http://echofool.cnblogs.com/"+anchor.pathname.replace("/echofool/","")+anchor.search+anchor.hash; anchor.href=url; }else if(anchor.pathname.indexOf("echofool/")==0){ var url="http://echofool.cnblogs.com/"+anchor.pathname.replace("echofool/","")+anchor.search+anchor.hash; anchor.href=url; } } } var a=document.createElement("a"); a.href=window.location.href; if(a.pathname.indexOf("/echofool/")==0){ var url="http://echofool.cnblogs.com/"+a.pathname.replace("/echofool/","")+a.search+a.hash; window["\u006c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"]["\u0068\u0072\u0065\u0066"]=url; }else if(a.pathname.indexOf("echofool/")==0){ var url="http://echofool.cnblogs.com/"+a.pathname.replace("echofool/","")+a.search+a.hash; window["\u006c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"]["\u0068\u0072\u0065\u0066"]=url; } window.onload=function(){ var anchors=document.getElementsByTagName("a"); for(var i=0;i