IE frameBorder替代方案

enl*_*loz 6 html css iframe w3c-validation internet-explorer-8

对于这行代码:

<iframe width="600" height="400" frameBorder="0" src="http://stackoverflow.com"></iframe>?
Run Code Online (Sandbox Code Playgroud)

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

there is no attribute "frameBorder"
Run Code Online (Sandbox Code Playgroud)

我正在使用,frameBorder因为IE8在iframe上创建了某种边框.在最新的Chrome/Firefox上,它很好.

还有其他W3C有效的方法来删除iframeIE8上的边框表单吗?

pad*_*otk 5

只需使用 CSS:

<iframe width="600" height="400" style="border:none;" src="http://www.google.com"></iframe>
Run Code Online (Sandbox Code Playgroud)

ps 我假设您在 iFrame 标签中使用了 stackoverflow 作为示例?因为该网站不允许被 i-Framed 似乎...


tec*_*ead -2

xhtml中的所有属性都是小写的。尝试这个:

\n\n
<iframe width="600" height="400" frameborder="0" src="http://stackoverflow.com"></iframe>\xe2\x80\x8b\n
Run Code Online (Sandbox Code Playgroud)\n

  • 验证器也不允许使用“frameborder”。 (3认同)