【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
如何从我的网络应用程序中嵌入的iframe
删除边框? iframe
一个示例是:
<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>
假设背景颜色一致,我希望从页面上的内容过渡到iframe
的内容是无缝的。 目标浏览器只是IE6,不幸的是其他人的解决方案无济于事。
#1楼
如果您放置iframe的页面的doctype是HTML5,那么您可以使用seamless
属性,如下所示:
<iframe src="..." seamless="seamless"></iframe>
#2楼
iframe src="XXXXXXXXXXXXXXX"
marginwidth="0" marginheight="0" width="xxx" height="xxx"
适用于Firefox;)
#3楼
我尝试了以上所有内容,如果这对您不起作用,请尝试以下CSS解决了我的问题。 这只是告诉浏览器不添加任何填充或边距。
* {
padding:0px;
margin:0px;
}
#4楼
使用HTML iframe frameborder属性
http://www.w3schools.com/tags/att_iframe_frameborder.asp
注意:对于IE使用帧B顺序(上限B),否则将无效。 但是,HTML5中不支持iframe frameborder属性。 所以,请改用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
#5楼
在试图删除IE7中的边框之后,我发现frameBorder属性区分大小写。
您必须使用大写B设置frameBorder属性。
<iframe frameBorder="0" ></iframe>
来源:oschina
链接:https://my.oschina.net/stackoom/blog/3147410