当我使用下面的代码来创建一个iframe:

<iframe src="mypage.html" style="border: 0; width: 100%; height: 100%">Your browser doesn't support iFrames.</iframe>

iframe并没有一直延伸——一个10px的白色“边框”围绕着iframe。我怎么解决这个问题呢?

这是这个问题的一个图像:


当前回答

用下面的代码代替它:

    <frameset rows="100%,*">
        <frame src="-------------------------URL-------------------------------">
        <noframes>
            <body>
                Your browser does not support frames. To wiew this page please use supporting browsers.
            </body>
        </noframes>
    </frameset>

其他回答

将这个添加到你的iframe中可能会解决这个问题:

frameborder="0"  seamless="seamless"

希望能有所帮助。

不可能在没有看到一个活生生的例子的情况下说,但尝试给两个主体边框:0px

用下面的代码代替它:

    <frameset rows="100%,*">
        <frame src="-------------------------URL-------------------------------">
        <noframes>
            <body>
                Your browser does not support frames. To wiew this page please use supporting browsers.
            </body>
        </noframes>
    </frameset>

尝试添加以下属性:

scrolling="no"

您可以尝试frameborder=0。