zoukankan      html  css  js  c++  java
  • HTML 框架

    一、iframe 内联框架

      iframe 标签它可以在一个 html 页面上,打开一个小窗口,去加载一个单独的页面。

      语法:

    <iframe src="URL"></iframe>
    

      常用属性:

      1、url:指向隔离页面的位置。

      2、height 和 width 属性用于规定 iframe 的高度和宽度。属性值的默认单位是像素,但也可以用百分比来设定(比如 "80%")。

      3、frameborder 属性规定是否显示 iframe 周围的边框。设置属性值为 "0" 就可以移除边框。

      4、scrolling 用于设置是否显示滚动条:auto( 在需要的情况下出现滚动条(默认值));yes(始终显示滚动条(即使不需要));no(从不显示滚动条(即使需要))。

      5、使用 iframe 作为链接的目标

      案例:

    <iframe src="demo_iframe.htm" name="iframe_a"></iframe>
    <p><a href="http://www.w3school.com.cn" target="iframe_a">hello world</a></p>
    

      

    二、frameset 框架

      <frameset> 通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。

      语法&案例:

    <frameset cols="25%,75%">
       <frame src="frame_a.htm">
       <frame src="frame_b.htm">
    </frameset>

      属性介绍:

      1、框架结构标签(<frameset>)定义如何将窗口分割为框架,每个 frameset 定义了一系列行或列

      2、rows/columns 的值规定了每行或每列占据屏幕的面积,可以使用具体的像素值,也可以使用百分比(%)来表示。

      3、假如一个框架有可见边框,用户可以拖动边框来改变它的大小。为了避免这种情况发生,可以在 <frame> 标签中加入:noresize="noresize" 来放置框架被拖动导致的变形。

      案例:

    <frameset rows="50%,50%">
    
      <frame src="/example/html/frame_a.html">
    
      <frameset cols="25%,75%">
        <frame src="/example/html/frame_b.html">
        <frame src="/example/html/frame_c.html">
      </frameset>
    
    </frameset>
    

      4、为不支持框架的浏览器添加 <noframes> 标签。

      Tips:不能将 <body></body> 标签与 <frameset></frameset> 标签同时使用!但是可以添加包含一段文本的 <noframes> 标签,就必须将这段文字嵌套于 <body></body> 标签内。

      案例:

    <frameset cols="25%,50%,25%">
      <frame src="/example/html/frame_a.html">
      <frame src="/example/html/frame_b.html">
      <frame src="/example/html/frame_c.html">
    
    <noframes>
    <body>您的浏览器无法处理框架!</body>
    </noframes>
    
    </frameset>
    

      

      更多的标签学习请参考这里:http://www.w3school.com.cn/html/index.asp

  • 相关阅读:
    Python socket 基础(Server)
    Python socket 基础(Client)
    DOM
    Software Testing Concepts
    coroutine
    这一周~&&html+css的学习感悟
    充实的几天~
    时间不够用的感觉
    论文真痛苦
    焦躁的一周……
  • 原文地址:https://www.cnblogs.com/niujifei/p/11074566.html
Copyright © 2011-2022 走看看