如何从嵌入在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,不幸的是,针对其他浏览器的解决方案将无济于事。
当前回答
除了添加frameBorder属性之外,您还可以考虑将滚动属性设置为“否”,以防止出现滚动条。
<iframe src="myURL" width="300" height="300" frameBorder="0" scrolling="no">Browser not compatible. </iframe >
其他回答
如果要放置iframe的页面的doctype是HTML5,则可以使用无缝属性,如下所示:
<iframe src="..." seamless="seamless"></iframe>
无缝属性上的Mozilla文档
可以使用Style属性对于HTML5,如果你想删除框架的边框或任何东西,你可以使用style属性。如下所示
此处显示代码
<iframe src="demo.htm" style="border:none;"></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>
要删除边框,可以将CSS边框属性设置为none。
<iframe src="myURL" width="300" height="300" style="border: none">Browser not compatible.</iframe>
添加frameBorder属性(大写“B”)。
<iframe src="myURL" width="300" height="300" frameBorder="0">Browser not compatible. </iframe>