滚动在div中的iframe中不起作用

时间:2013-02-27 11:43:08

标签: html iframe scroll scrollbar

我不擅长编码,这次我甚至无法从互联网上找到答案 我做了一个iframe并把它放在div里面。我想滚动iframe中的内容,但出于某种原因我无法滚动到页面的末尾。

我不太擅长解释,所以我希望这些照片能清楚我的意思:
我有什么:http://i87.photobucket.com/albums/k123/gaikotsu_/scroll.png
我想要的是:http://i87.photobucket.com/albums/k123/gaikotsu_/scroll2.png

如您所见,iframe在底部被剪切,因此缺少3行艺术品。我已经尝试过所有我能想到的东西,而这只会让我感到沮丧!

这是div的css:

   #main {
    background-color: transparent;
}

.frame {
    display: block;
    border: medium none;
    position: absolute
    height: 100%;
    width: 100%;
    overflow: hidden;
}

以下是我创建div / iframe的方法:

<div id="main" style="overflow-y: auto; height: 100%; overflow-x: hidden; position: absolute; left: 294; top: 44; border: ">
<iframe name="main" src="main.htm" height="710px" width="610px" scrolling="no" border="0" frameborder="0" allowtransparency="true" class="frame">
    </iframe>
</div>

我感谢任何帮助!谢谢你的阅读!

2 个答案:

答案 0 :(得分:1)

您在.frame CSS中的position: absolute后缺少分号。

它使下一行height:100%未解析。

答案 1 :(得分:0)

我也遇到了同样的问题。 我设置了

iframe{
    height: 100%; 
   }

它对我有用。