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

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

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


当前回答

对我来说,添加非常有效

.iframe{
box-shadow: none !important;
}

这个解决方案特别适用于我正在编辑的shopify主题。shopify主题在整个主题中以不同的方式使用iframe,其中一个出现了故障。我不得不手动进入css并覆盖css属性。

其他回答

如果您使用iFrame来适应整个屏幕的宽度和高度(我假设您不是基于300x300尺寸),则还必须将主体边距设置为“0”,如下所示:

<body style="margin:0px;">

1.通过内联样式集边框:0

 <iframe src="display_file.html" style="height: 400px; width:
   100%;border: 0;">HTML iFrame is not compatible with your browser
   </iframe>

2.通过标记属性框架边框集0

<iframe src="display_file.html" width="300" height="300" frameborder="0">Browser not compatible.</iframe>

3.如果我们有多个I帧,我们可以在内部或外部给class和Put css。

HTML格式:

<iframe src="display_file.html" class="no_border_iframe">
    HTML iFrame is not compatible with your browser 
</iframe>

CSS:

<style>
.no_border_iframe{
border: 0; /* or border:none; */
}
</style>

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

添加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>

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

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