• 8.10前端之Html框架


    8.10前端之Html框架

    作用

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

    • 每份HTML文档称为一个框架

    • 每个框架都独立于其他的框架。

    使用框架的坏处:

    • 开发人员必须同时跟踪更多的HTML文档

    • 很难打印整张页面

    分类

    • 垂直框架

    • 水平框架

    • 混合框架

    • 导航框架

    • 内联框架


    框架结构标签<frameset>

    • 框架结构标签(<frameset>)定义如何将窗口分割为框架

    • 每个 frameset 定义了一系列行

    • rows/columns 的值规定了每行或每列占据屏幕的面积

    框架标签<frame>
    • 定义了放置在每个框架中的 HTML 文档

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

    重要提示

    不能将 <body></body> 标签与 <frameset></frameset> 标签同时使用!不过,假如你添加包含一段文本的 <noframes> 标签,就必须将这段文字嵌套于 <body></body> 标签内。(在下面的第一个实例中,可以查看它是如何实现的。)

    使用<noframes>标签
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content="这是一个框架的练习" />
    <title>A demo about frame</title>
    </head>

    <frameset cols="40%,30%,30%">
    <frame src="SemanticDemoPractice.html" />
    <frame src="BootstrapDemoPractice.html" />
    <frame src="ColumnPracticeDemoNo1.html" />

    <noframes>
    <body>
    浏览器无法处理框架!!!
    <body>
    </noframes>
    </frameset>
    </html>
    垂直框架--->cols(列属性)
        <frameset cols="40%,30%,30%">
    <frame src="SemanticDemoPractice.html" />
    <frame src="BootstrapDemoPractice.html" />
    <frame src="ColumnPracticeDemoNo1.html" />

    <noframes>
    <body>
    浏览器无法处理框架!!!
    <body>
    </noframes>
    </frameset>
    水平框架--->rows(行属性)
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content="这是一个框架的练习,试用水平排版" />
    <title>This is a practice about rows</title>
    </head>

    <frameset rows="30%,20%,30%">
    <frame src="IframePractice.html" />
    <frame src="PracticeDemoNo1.html" />
    <frame src="ResponsiveDesignPractice.html" />
    </frameset>
    <body>
    </body>
    </html>
    混合框架结构--->嵌套<frameset>标签
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content="这是一个关于框架的练习Demo" />
    <title>This is a Demo</title>
    </head>
    <frameset rows="50%">
    <frame src="FramesetPracticeDemoNo3.html" />
    <frameset cols="30%,30%,40%">
    <frame src="SemanticDemoPractice.html" />
    <frame src="PracticeList.html" />
    <frame src="IframePractice.html" />
    </frameset>
    </frameset>
    </html>
    导航框架

    目标Html

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <body>
    <a href="BootstrapDemoPractice.html" target="showframe">没有锚的连接</a>
    <br />
    <a href="SemanticDemoPractice.html#C10" target="showframe">带有锚的连接</a>
    </body>
    </html>

    SemanticDemoPractice

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content="语义元素的练习" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Practice about Semantic Elements</title>
    </head>
    <body>
    <nav>
    <a href="TablePracticeDemoNo1.html">Table</a> |
    <a href="SemanticDemoPractice.html">Semantic</a> |
    <a href="ResponsiveDesignPractice.html">Response</a>
    </nav>
    <section contenteditable="false">
    <h1>Semantic Elements</h1>
    <p contenteditable="true" style="font-family: '微软雅黑'; color: saddlebrown; font-size: medium;">This is a content about Semantic Elements</p>
    </section>
    <section contenteditable="false">
    <h1>Content</h1>
    <p contenteditable="true" style="font-family: '微软雅黑'; color: darkmagenta; font-size: large;">Input Something</p>
    </section>
    <article contenteditable="false" style="font-family: '微软雅黑'; color: black; font-size: large;">
    <h1>What can you do</h1>
    <p contenteditable="false" style="font-family: '微软雅黑'; color: royalblue; font-size: medium;">It is a content</p>
    </article>
    <br />
    <article contenteditable="false" style="font-family: '微软雅黑'; color: blanchedalmond;">
    <header contenteditable="false" style="font-family: '微软雅黑'; color: darkblue; font-size: larger;">
    <h1>Title of the article</h1>
    <p contenteditable="false" style="font-family: '微软雅黑'; color: black; font-size: medium;">What is the title of the article</p>
    </header>
    <p contenteditable="true" style="font-family: '微软雅黑'; color: black; font-size: initial;">Input your answer</p>
    <footer contenteditable="false" style="font-family: '微软雅黑'; color: darkcyan; font-size: inherit;">
    <p contenteditable="false">Information from:<a href="PracticeList.html">Lucifer@163.com</a>.</p>
    </footer>
    </article>
    <br />
    <article contenteditable="false" style="font-family: '微软雅黑';" id="C10">
               <!--这里是锚的位置-->
    <p contenteditable="false" style="font-family: '微软雅黑';">This is a content</p>
    <aside contenteditable="false" style="font-family: '微软雅黑'; color: red; font-size: inherit;">
    <ul contenteditable="false" style="font-family: '微软雅黑'; color: hotpink;">
    <li>Html</li>
    <li>Css</li>
    <li>JavaScript</li>
    </ul>
    </aside>
    </article>
    <br />
    <p contenteditable="false">This is a content about picture</p>
    <figure>
    <figcaption contenteditable="false" style="font-family: '微软雅黑'; color: red; text-align: left;">皮卡丘,大大大</figcaption>
    <img src="../Picture/Big.gif" alt="This is a Picture" width="304" height="228" />
    </figure>
    <br />
    <p contenteditable="false" style="font-family: '微软雅黑';color: red;">字符实体</p>
    <p contenteditable="false">&X;</p>
    <p contenteditable="false">&#174</p>
    <br />
    <p contenteditable="false">将要显示 &</p>
    <p contenteditable="false">将要显示 &#8364</p>
    <p contenteditable="false">将要显示 &#x20AC</p>
    </body>
    </html>

    导航Html

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content="这是另一个关于框架的练习" />
    <title>This is another practice about frameset</title>
    </head>
    <frameset cols="120,*">
    <frame src="TargetDemo.html" />
    <frame src="SemanticDemoPractice.html#C10" name="showframe" />
    </frameset>
    </html>
    不可改变框架大小的属性--->noresize属性
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>This is a Demo</title>
    </head>
    <frameset cols="30%,30%" noresize="noresize">
    <frame src="ColumnPracticeDemoNo1.html" />
    <frame src="TargetDemo.html" />
    </frameset>
    <body>
    </body>
    </html>

    这个效果会将目标的引用部分的内容直接指向内联框架--->实现在一个Html界面打开多个Html内容

    几个需要注意的点:

    • 使用框架导航跳转至指定的节--->需要定位到指定Html的锚的话需要在src引用的时候带上锚

    • 跳转至框架内一个指定的节--->直接在src引用上带上锚,在frameset会直接展示锚部分的内容

    • 没有noresize属性的框架其边界都是可以拖动的

    It's a lonely road!!!
  • 相关阅读:
    9、par画图参数
    awk
    Android Studio Gradle下载的包在哪里?
    .net core webapi 在原有基础上修改。
    .net core webapi 部署到 IIS
    原来部署好的WCF(可以调用),因为部署.net core,而安装了DotNetCore.2.0.5-WindowsHosting,导致现在WCF站点不可以。
    sql2008R2新建链接服务器。
    Dynamics CRM 365常用js记录。
    <div>标签输入文字
    dynamics crm 365 附件上传图片并且显示。
  • 原文地址:https://www.cnblogs.com/JunkingBoy/p/15129863.html
Copyright © 2020-2023  润新知