如何从嵌入在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 src="XXXXXXXXXXXXXXX"
marginwidth="0" marginheight="0" width="xxx" height="xxx"
适用于Firefox;)
其他回答
如果要放置iframe的页面的doctype是HTML5,则可以使用无缝属性,如下所示:
<iframe src="..." seamless="seamless"></iframe>
无缝属性上的Mozilla文档
添加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>
<iframe src="mywebsite" frameborder="0" style="border: 0px solid white;">HTML iFrame is not compatible with your browser</iframe>
这段代码应该可以在HTML4和HTML5中使用。
要删除边框,可以将CSS边框属性设置为none。
<iframe src="myURL" width="300" height="300" style="border: none">Browser not compatible.</iframe>