18. HTML 框架 frame 导航框架, 内联框架

一:

    1. 作用: 可以在同一个浏览器窗口显示多个页面。

    2. 分类: (1)垂直框架。

                 (2)水平框架。

   3. 方法: <frameset> </frameset>

                属性rows, cols规定行列占据屏幕的的面积。

   4. 注意: (1)不能将<body></body>和<frameset></frameset>同时使用。

                (2)如果添加包含一段文本的<noframes> tag, 就必须将这段文字嵌套于<body></body> tag内。

                          <frameset>

                                <frame src = "">

                                <noframes>

                                    <body>Your browser can't handle framseset.</body>

                                </noframes>

                          </frameset>

                 (3) 为了避免用户拖动边框来改变大小, 可以添加<frame src = "...." noresize = "noresize"> </frame>

二: 实例演示

    <html>

    <frameset cols = "25%, 75%">

        <frame src = "frame_a.html">

        <frame src = "frame_b.html">

    </frameset>

    </html>

三: 实例

  (1)   导航框架

     <frameset cols = "120, *">

        <frame src = "/example/html/html_contents.html">

        <frame src = "/example/html/frame_a.html" name = "showframe">

     </frameset>

    html_contents.html

     <a href = "/example/html/frame_a.html" target = "showframe">Frame a</a>

     <br />

     <a href = "/example/html/frame_b.html" target = "showframe"">Frame b </a>

     <br />

     <a href = "/example/html/frame_c.html" target = "showframe">Frame c</a>

    (2) 内联框架 <iframe src = "...."> </iframe>

四: 跳转至框架内某一节

      <frame src = "a.html#C10">

      C10由a.html内的<a name = "C10">....</a>进行标识。

   

原文地址:https://www.cnblogs.com/gavinwu/p/3204906.html