如何从嵌入在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,不幸的是,针对其他浏览器的解决方案将无济于事。
当前回答
您可以在iframe代码中使用style=“border:0;”。这是HTML5中删除边框的推荐方法。
查看我的html5 iframe生成器工具,无需编辑代码即可自定义iframe。
其他回答
我有一个底部白色边框的问题,我无法用边框、边距和填充规则解决它。。。所以添加display:块;因为iframe是一个内联元素。
这将考虑HTML中的空白。
<iframe src="mywebsite" frameborder="0" style="border: 0px solid white;">HTML iFrame is not compatible with your browser</iframe>
这段代码应该可以在HTML4和HTML5中使用。
添加frameBorder属性(注意大写“B”)。
所以它看起来像:
<iframe src="myURL" width="300" height="300" frameBorder="0">Browser not compatible.</iframe>
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="XXXXXXXXXXXXXXX"
marginwidth="0" marginheight="0" width="xxx" height="xxx"
适用于Firefox;)