我需要以隐藏标题的方式加载带有 iframe 的页面。我尝试了以下但由于某种原因它不起作用:
<div style="width:945px; height:600px; overflow:hidden;">
<iframe src="innerpage.html"
frameborder="0"
height="700"
scrolling="no"
width="945"
style="top:-100px" />
</div>
最佳答案
meder 说的对,但也有可能是你的style 什么都不做。您需要设置 position: absolute
或 position: static
以便 top
产生任何影响。
这只会向上移动整个 iframe,而不是 iframe 中的内容。
关于css - 定位 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1526425/