禁用iframe自动调整大小 [英] disable iframe auto resize
问题描述
我正在使用其中包含iframe的网页。 iframe中有相当数量的数据,并且每次加载其高度都会扩展到其中的内容范围。然而,这将我的页面。反正是否有锁定iframe的高度并允许用户滚动内容?
I am working with a webpage with an iframe within it. The iframe has a fair amount of data in it and every-time it loads its height expands to the extent of the content within. However this puts my page out. Is there anyway to lock the height of the iframe and allow the user too scroll through the content??
推荐答案
嗯,很奇怪。 ..你有这个问题的示例链接吗?
Hmm, weird... do you have an example link of this issue?
当我尝试一个简单的iframe时:
http://jsfiddle.net/mP6wT/5/
When I try a simple iframe: http://jsfiddle.net/mP6wT/5/
<iframe src="http://example.org/"></iframe>
默认情况下,它的大小似乎相当小,并在Chrome / FF / Win中滚动...而不是调整到高度...
It seems to be sized pretty small by default, and scrolls in Chrome/FF/Win... Rather than adjusting to the height...
但无论如何,你应该能够用CSS锁定高度:
http://jsfiddle.net/mP6wT/7/
But at any rate, you should be able to lock the height with CSS: http://jsfiddle.net/mP6wT/7/
<iframe src="http://example.org/" style="height:400px;"></iframe>
这篇关于禁用iframe自动调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!