html - IE frameBorder替代方案

标签 html css iframe internet-explorer-8 w3c-validation

对于这行代码:

<iframe width="600" height="400" frameBorder="0" src="http://stackoverflow.com"></iframe>​

我收到此错误:(validator.w3.org : XHTML 1.0 Transitional)

there is no attribute "frameBorder"

我正在使用 frameBorder 因为 IE8 在 iframe 上创建了某种边框。在最新的 Chrome/Firefox 上没问题。

是否有任何其他 W3C 有效的方法来删除 IE8 上的 iframe 边框形式?

最佳答案

只需使用 CSS:

<iframe width="600" height="400" style="border:none;" src="http://www.google.com"></iframe>

附注我假设您在 iFrame 标记中使用了 stackoverflow 作为示例?因为该站点不允许使用 i-Framed 似乎...

关于html - IE frameBorder替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9985658/

相关文章:

javascript - 如何通过 dom 开头的属性名称删除 iframe?

javascript - 通过 iFrame 更改页面 URL?

javascript - 如何设置float :right in my case using css?

html - 从表行中的输入插入数据

html - 将单个输入表单分成不同的部分

html - 我可以同时使用 flexbox 和 float 吗?或者使用具有绝对定位的 flexbox?

javascript - 滚动变换 - 就像在 Medium.com 上一样流畅

html - 由于 Firefox 中的长内联 block 导致边框分离

jquery - 在 jQuery 中的同一 div 中分离 "click on text"和 "click on background"事件

javascript - 如何使 IFrame 链接打开到新窗口?