javascript - IE 8 iframe 边框

标签 javascript html css iframe internet-explorer-8

iframe 上显示了一个边框,我无法摆脱它。

IE 6 和 7 使用少量 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 中仍然可见。

最佳答案

将以下属性添加到 iframe 标记:

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

关于javascript - IE 8 iframe 边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1625835/

相关文章:

javascript - 在子元素的指令中获取 CSS 属性

javascript - 无法迭代 mongodb 集合

javascript - 我应该使用 prefixfree.js 吗?

具有等高列的 CSS Fluid-Fixed 布局

javascript - Puppeteer 找不到 Xpath

javascript - 来自单个事件的多个 JQuery 效果

css - 为什么我的图像在 Firefox 和 Chrome 中太左对齐

jquery - JvectorMaps 的不同颜色标记

css - 从外部目录导入 Sass 样式表

html - 如何让文本在换行符处对称排列