Skip to content

iframe元素

框架页 一般用于嵌入别人的网页,比如别人的视频不让拿走,就可以使用iframe

通常用于在网页中嵌入另一个页面

iframe 可替换元素

  1. 通常行盒
  2. 通常显示的内容取决于元素的属性
  3. CSS不能完全控制其中的样式
  4. 具有行快盒的特点
html
    <a href="https://www.baidu.com" target="myframe">百度</a>
    <!-- 设置了target之后,就可以在iframe中切换 -->
    <a href="https://douyu.com" target="myframe">斗鱼</a>
    <a href="https://www.taobao.com" target="myframe">淘宝</a>

    <iframe name="myframe" src="https://www.baidu.com"></iframe>

在页面中使用flash

需要使用两个元素 object embed

它们都是可替换元素

MIME(Multipurpose Internet Mail Extensions)

多用途互联网邮件类型:

比如,资源是一个jpg图片,MIME:image/jpeg

html
    <!-- object元素可以传递参数 -->
    <object data="./example.swf" type="application/x-shockwave-flash">
        <param name="quality" value="high">
    </object>

    <!-- embed元素传递参数直接写成属性的格式即可 -->
    <embed quality="high" src="./example.swf" type="application/x-shockwave-flash">

    <!-- 兼容的写法:一般都是object包裹embed -->
    <object data="./example.swf" type="application/x-shockwave-flash">
        <param name="quality" value="high">
        <embed quality="high" src="./example.swf" type="application/x-shockwave-flash">
    </object>

MIT License