zoukankan      html  css  js  c++  java
  • iframe用法

    <iframe src="http://caiyanli.top/" height="500"  width="500" frameborder="0"

     marginheight="2" marginwidth="0" scrolling="yes"></iframe>

    注:iframe h5 新增标签,元素会创建包含另外一个文档的内联框架(即行内框架)。

    您可以把需要的文本放置在 <iframe> </iframe> 之间,这样就可以应对无法理解 iframe 的浏览器。

    iframe属性和值和作用

    属性

    作用

    frameborder

    • 1
    • 0

    规定是否显示框架周围的边框。

    height

    • pixels
    • %

    规定 iframe 的高度。

    longdesc

    URL

    规定一个页面,该页面包含了有关 iframe 的较长描述。

    marginheight

    pixels

    定义 iframe 的顶部和底部的边距。

    marginwidth

    pixels

    定义 iframe 的左侧和右侧的边距。

    name

    frame_name

    规定 iframe 的名称。

    sandbox

    • ""
    • allow-forms
    • allow-same-origin
    • allow-scripts
    • allow-top-navigation

    启用一系列对 <iframe> 中内容的额外限制。

    scrolling

    • yes
    • no
    • auto

    规定是否在 iframe 中显示滚动条。

    seamless

    seamless

    规定 <iframe> 看上去像是包含文档的一部分。

    src

    URL

    规定在 iframe 中显示的文档的 URL

    srcdoc

    HTML_code

    规定在 <iframe> 中显示的页面的 HTML 内容。

    width

    • pixels
    • %

    定义 iframe 的宽度。

    代码:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>我的网页</title>
    </head>
    <body bgcolor="#ff9900">
    <h1>我的网页</h1>
    <hr>
    <iframe src="http://caiyanli.top/" height="500" frameborder="0" marginheight="2" marginwidth="0" scrolling="yes">看不到我</iframe>
    </body>
    </html>

  • 相关阅读:
    Schema和数据类型优化?
    语雀发布博客园
    为知笔记文章目录
    码云搭建博客
    springboot的过滤器、监听器、拦截器
    springboot常用注解
    springboot使用小技巧合集
    springboot整合swagger2
    强制卸载win软件
    xshell下载和优化配置
  • 原文地址:https://www.cnblogs.com/gvip-cyl/p/6257594.html
Copyright © 2011-2022 走看看