如何从嵌入在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="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.
其他回答
使用HTML iframe frameborder属性
http://www.w3schools.com/tags/att_iframe_frameborder.asp
注意:IE使用frameBorder(cap B),否则将无法工作。但是,HTML5不支持iframeframeborder属性。因此,请改用CSS。
<iframe src="http://example.org" width="200" height="200" style="border:0">
也可以使用滚动属性删除滚动http://www.w3schools.com/tags/att_iframe_scrolling.asp
<iframe src="http://example.org" width="200" height="200" scrolling="no" style="border:0">
此外,您还可以使用HTML5中新增的无缝属性。iframe标签的无缝属性仅在Opera、Chrome和Safari中受支持。当出现时,它指定iframe看起来应该是包含文档的一部分(没有边框或滚动条)。目前,标签的无缝属性仅在Opera、Chrome和Safari中受支持。但在不久的将来,它将成为标准解决方案,并与所有浏览器兼容。http://www.w3schools.com/tags/att_iframe_seamless.asp
在尝试删除IE7中的边框后,我发现frameBorder属性区分大小写。
必须将frameBorder属性设置为大写B。
<iframe frameBorder="0"></iframe>
根据iframe文档,frameBorder已被弃用,首选使用“border”CSS属性:
<iframe src="test.html" style="width: 100%; height: 400px; border: 0"></iframe>
注意CSS边界属性在IE6、7或8中没有达到预期的结果。
对于特定于浏览器的问题,还可以根据Dreamweaver添加frameborder=“0”hspace=“0“vspace=“1”marginheight=“2”marginwidth=“0”:
<iframe src="test.html" name="banner" width="300" marginwidth="0" height="300" marginheight="0" align="top" scrolling="No" frameborder="0" hspace="0" vspace="0">Browser not compatible. </iframe>
Try
<iframe src="url" style="border:none;"></iframe>
这将删除框架的边框。