项目中还在使用 Iframe ,一次看代码时发现 Iframe 没有指定高度、宽度,可是在页面上显示的时候却有高度、宽度。想着应该是 Iframe 的默认值,于是写了一个简单的页面,代码如下:

 1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="text/javascript">
5 function aaa() {
6 //alert(0);
7 alert("document.getElementById('Iframe2').clientHeight:" + document.getElementById("Iframe2").clientHeight);
8 alert("document.getElementById('Iframe2').clientWidth:" + document.getElementById("Iframe2").clientWidth);
9 }
10 </script>
11 </head>
12 <body onload="aaa()">
13 <iframe name="Iframe2" id="Iframe2" src="" style="" scrolling="yes"></iframe>
14
15 </body>
16
17 </html>

在 Firefox、Chorme、IE 上试了下显示的值都是 Height:150、Weight:300.

Iframe 默认高度、宽度的更多相关文章

  1. iframe高度宽度自适应(转)

    http://www.cnblogs.com/snandy/p/3900016.html 跨子域的iframe高度自适应 完全跨域的iframe高度自适应 同域的我们可以轻松的做到 1. 父页面通过i ...

  2. 让动态的 iframe 内容高度自适应

    使用iframe加载其他页面的时候,需要自适应iframe的高度 这里加载了两个不同内容高度的页面至iframe中 1. 没有设置高度 <div class="iframe-wrapp ...

  3. jquery iframe自适应高度[转]

      经典代码 iFrame 自适应高度,在IE6/IE7/IE8/Firefox/Opera/Chrome/Safari通过测试. 很古老的方法: <iframe src="../In ...

  4. iframe自定义高度

    function setIframeHeight() { var iframe=document.getElementById("iframe_id"); iframe.heigh ...

  5. iframe的高度自适应

    http://www.cnblogs.com/snandy/p/3902337.html http://www.cnblogs.com/snandy/p/3900016.html Snandy Sto ...

  6. 同域iframe的高度自适应

    引子 父页面里控制子页面 子页面里控制父页面 一.引子 我们先看一个示例,有两个页面,1.html通过iframe嵌入2.html,两个页面都是同域的 1.html <!DOCTYPE html ...

  7. iOS iPhone iPad 各种控件默认高度

    iPhone iPad 各种控件默认高度 注意:这些是ios7之前的,ios7之后(包括ios7)有改动,我会在后面标注出来 iPhone和iPad下各种常见控件的宽度和标准是一样的,所以这里就用iP ...

  8. iOS开发——基本常识篇&各种控件默认高度

    各种控件默认高度   1.状态栏 状态栏一般高度为20像素,在打手机或者显示消息时会放大到40像素高,注意,两倍高度的状态栏在好像只能在纵向的模式下使用.如下图 用户可以隐藏状态栏,也可以将状态栏设置 ...

  9. 【转】iOS开发——基本常识篇&各种控件默认高度

    原文:http://www.cnblogs.com/iCocos/p/4595614.html 各种控件默认高度   1.状态栏 状态栏一般高度为20像素,在打手机或者显示消息时会放大到40像素高,注 ...

  10. jQuery iframe 自适应高宽度

    Html <iframe id="你的id" src="你要嵌入的页面" scrolling="no" frameborder=&qu ...

随机推荐

  1. python数据方面的文章

    excel 对接 jupyter      https://mp.weixin.qq.com/s/NTCIOs_Yz3MIRgT8S36yGQ pandas 常用分拆数据         https: ...

  2. c++获取类型信息

    获取类型信息 typeid typeid运算符用来获取一个表达式的类型信息. 对于基本类型数据, 类型信息比较简单, 主要指数据的类型; 对于对象(类类型的数据), 类型信息指: 对象所属的类, 所包 ...

  3. allure+junit5遇到的一些问题

    java+junit5+allure 之前引testng,还比较顺利,见上一篇博客,然后testng的注解和junit不一样,感觉junit5更好用一些,所以尝试java+junit5+allure ...

  4. 解决使用mapstruct过程中的一次编译报错问题_Internal error in the mapping processor

    说明 mapstruct版本:1.2.0.Final 开发工具:IntelliJ IDEA 2021.3.1 (Ultimate Edition) 报错现象 java: Internal error ...

  5. xshell 恢复窗口布局

    ctrl +shift +t  

  6. C# 日期获得一天的起始时间

    dateTimePicker1.Value = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); ...

  7. centos7 elasticsearch集群安装

    1.下载安装包 https://www.elastic.co/cn/downloads/past-releases#elasticsearch elasticsearch-7.6.1-linux-x8 ...

  8. Ubuntu20.04 LTS更新源

    Ubuntu 20.04 LTS Focal Fossa于2020年04月23日发布. 备份sudo cp /etc/apt/sources.list /etc/apt/sources.list.ba ...

  9. 7.26-javascript

    折半查找:数据必须有序 //数组定义 let arr1 = [1,2,3,4,5]; //用字面量定义数组 let arr2 = new Array(1,2,3,4,5); //用字面量定义数组 le ...

  10. 快速排序(QuiteSort)

    快速排序算法(QuiteSort)是基于分治策略的一个算法.其基本算法是,对于输入的子数组a[p,r],按以下3个步骤进行排序: (1)分解(divide):以 a[p]为基准元素将a[p:r]划分成 ...