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

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

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


当前回答

在尝试删除IE7中的边框后,我发现frameBorder属性区分大小写。

必须将frameBorder属性设置为大写B。

<iframe frameBorder="0"></iframe>

其他回答

在样式表中添加

{
  padding:0px;
  margin:0px;
  border: 0px

}

这也是一个可行的选择。

iframe标记frameborder=0中的简单添加属性<iframe src=“”width=“200”height=“200”frameborder=“0”></iframe>

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

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

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

添加frameBorder属性,或使用边框宽度为0px;的样式;,或将边框样式设置为无。

使用以下3项中的任意一项:

浏览器不兼容</iframe><iframe src=“myURL”width=“300”height=“300”frameborder=“0”>浏览器不兼容</iframe><iframe src=“myURL”width=“300”height=“300”style=“border:none;”>浏览器不兼容</iframe>

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

所以它看起来像:

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