开发者

Competely removing an <iframe> border

Does anybody know how to completely remove an iframe border? I am using Firefox 3.x and the iframe is set to completely occupy the browser window - height="100%" width="100%"

I have already set frameBorder="0" and scrolling="no" but there is some space remaining at the border between the window and the iframe. Is the problem with 100% width and heig开发者_开发百科ht? Do I need to set more than 100%? By how much?


Do you mean the margin/padding?

In the html file your iframe is displaying try the following CSS:

body {
    margin: 0;
    padding 0;
}

edit: It could also be similar for your iframe element itself. If the above doesn't work, in the parent html page try:

iframe {
    padding: 0;
    margin: 0;
}


This worked for me by disabling border to iframe tags :

iframe {
    border:none;
}


<style>
    html,body, div, iframe{
        height: 100%;
        overflow: hidden;
        margin: 0; padding: 0;
    }
</style>

<iframe src="http://www.cnn.com" frameborder="no"></iframe>

see http://api.fatherstorm.com/test/4159620.php for an example


hspace="0" vspace="0" marginHeight = "0" marginWidth = "0" scrolling= "no" frameBorder="0"                              allowtransparency="true"


I use border: none; to fix this issue in Firefox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜