IE 8 iframe边框 [英] IE 8 iframe border

查看:93
本文介绍了IE 8 iframe边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iframe 上有一个边框,我无法清除。

There is a border showing on an iframe and I can't get rid of it.

IE 6和7按照预期使用一些JavaScript:

IE 6 and 7 work as intended with a little JavaScript:

function test(){
    var iframe = document.getElementById('frame2');
    iframe.contentWindow.document.body.style.backgroundColor = "#a31d1d";
    iframe.contentWindow.document.body.style.border = "#a31d1d";
    iframe.contentWindow.document.body.style.outlineColor = "#a31d1d";
}

但边框在IE 8中仍然可见。

But the border remains visible in IE 8.

推荐答案

向iframe标记添加以下属性:

Add following attributes to iframe tag:

marginheight="0" marginwidth="0" frameborder="0"

这篇关于IE 8 iframe边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆