English 中文(简体)
Iframe within a DIV incompatibility Mack-Firefox
原标题:Iframe inside a DIV incompatibility Chrome-Firefox

请在div内插入<>iframe>>:

<div id="big-box">
    <iframe src="http://www.google.com" class="frame">
    </iframe>
</div>

并且利用科学、技术和科学中心来请iframe占据所有现有的屏幕区域:

#big-box {
    background-color: #aaf;
}

.frame {
    border: medium none;
    height: 100%;
    width: 100%;
}

它完美无缺(12.07),但因之无效(3.6.17)。 http://jsfiddle.net/navi2000/4wevP/1/“rel=”nofollow> 该表显示,在整个联合后勤业务区域, Chrome中包含iframe,但如果你在iframe上试验这一样本,则将占用所有宽度,但并非全部高度。

请注意,如果你为big- Box设定了宽度和高度,它就发挥了作用,但这不是问题(我可以改变这一点)。 问题在于,为什么这种不兼容以及如何加以纠正(常常是 Chrome)。

最佳回答

谷歌最新版本(14.0.835)以最接近的版本(3.6.23)和最新版本的EE(9.0.3)一样的方式展示了这种dle。 因此,你可以看到,谷歌之首已经做了“权利”的事情。 它显示了你们的错误愿望......

添加<条码>:绝对;至<条码>。 它面向所有三个上述浏览器。

http://jsfiddle.net/Q5mt5/1“rel=“nofollow”

问题回答

Firefox is correct here. An iframe is an inline replaced element by default, so it sits on the baseline. If you add display: block; to the style for the frame class, then it will obey block sizing rules and completely cover the div.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签