如何从嵌入在web应用程序中的iframe中删除边框?iframe的一个示例是:
<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>
我希望从页面上的内容到iframe内容的转换是无缝的,假设背景颜色是一致的。目标浏览器仅为IE6,不幸的是,针对其他浏览器的解决方案将无济于事。
如何从嵌入在web应用程序中的iframe中删除边框?iframe的一个示例是:
<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>
我希望从页面上的内容到iframe内容的转换是无缝的,假设背景颜色是一致的。目标浏览器仅为IE6,不幸的是,针对其他浏览器的解决方案将无济于事。
当前回答
我尝试了上面的所有方法,如果这些方法对你不起作用,那么试试下面的CSS解决了我的问题。它只是告诉浏览器不要添加任何填充或边距。
* {
padding:0px;
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 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.
如果您使用iFrame来适应整个屏幕的宽度和高度(我假设您不是基于300x300尺寸),则还必须将主体边距设置为“0”,如下所示:
<body style="margin:0px;">
添加frameBorder属性(大写“B”)。
<iframe src="myURL" width="300" height="300" frameBorder="0">Browser not compatible. </iframe>
使用此
style="border:none;
例子:
<iframe src="your.html" style="border:none;"></iframe>