我在HTML5文档上有一个iframe.当我验证时,我收到一个错误,告诉我该属性iframe frameBorder已过时并使用CSS代替.
我在frameBorder="0"这里有这个属性,因为这是我弄清楚如何摆脱IE中的边界的唯一方法,我border:none;在CSS中尝试没有运气.是否有合规的方法来解决这个问题?
谢谢.
有一个边界显示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";
}
Run Code Online (Sandbox Code Playgroud)
但是在IE 8中边界仍然可见.