如何从嵌入在web应用程序中的iframe中删除边框?iframe的一个示例是:

<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>

我希望从页面上的内容到iframe内容的转换是无缝的,假设背景颜色是一致的。目标浏览器仅为IE6,不幸的是,针对其他浏览器的解决方案将无济于事。


当前回答

我有一个底部白色边框的问题,我无法用边框、边距和填充规则解决它。。。所以添加display:块;因为iframe是一个内联元素。

这将考虑HTML中的空白。

其他回答

根据iframe文档,frameBorder已被弃用,首选使用“border”CSS属性:

<iframe src="test.html" style="width: 100%; height: 400px; border: 0"></iframe>

注意CSS边界属性在IE6、7或8中没有达到预期的结果。

我有一个底部白色边框的问题,我无法用边框、边距和填充规则解决它。。。所以添加display:块;因为iframe是一个内联元素。

这将考虑HTML中的空白。

添加frameBorder属性(注意大写“B”)。

所以它看起来像:

<iframe src="myURL" width="300" height="300" frameBorder="0">Browser not compatible.</iframe>
<iframe src="URL" frameborder="0" width="100%" height="200">
<p>Your browser does not support iframes.</p>
</iframe>

<iframe frameborder="1|0">

(OR)

<iframe src="URL" width="100%" height="300" style="border: none">Your browser 
does not support iframes.</iframe>

The <iframe> frameborder attribute is not supported in HTML5. Use CSS 
instead.

要删除边框,可以将CSS边框属性设置为none。

<iframe src="myURL" width="300" height="300" style="border: none">Browser not compatible.</iframe>