惠灵顿天气,战火奇侠电视剧全集,美国动态网
ie5.5开始支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。
1.与 iframe 元素一起使用的 allowtransparency 标签属性必须设置为 true。
2.在 iframe 内容源文档,background-color 或 body 元素的 bgcolor 标签属性必须设置为 transparent
<iframe src="./ads_top_tian.html" allowtransparency="true" style="background-color=transparent" title="test" frameborder="0" width="470" height="308" scrolling="no"></iframe>
当然前提是iframe页面中没有设置颜色.
在上面我们主要是看到了style中的一句代码style="background-color=transparent" 通过以下四种iframe的写法我想大概你对iframe背景透明效果的实现方法应该会有个清晰的了解:
<iframe id="frame1" src="transparentbody.htm" allowtransparency="true"></iframe>
<iframe id="frame2" src="transparentbody.htm" allowtransparency="true" style="background-color: green"> </iframe>
<iframe id="frame3" src="transparentbody.htm"></iframe>
<iframe id="frame4" src="transparentbody.htm" style="background-color: green"> </iframe>
现在我们来看一个实例
本例主要是iframe对象的allowtransparency属性应用,在该属性设置为true并且iframe所载加页的背景颜色设置为transparent(透明)时iframe将透明化。
allowtransparency设置或获取对象是否可为透明。
bgcolor 设置或获取对象的背景颜色
父页面
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>父页面</title>
</head>
<body bgcolor="#ff0000">
<iframe src="index.htm" allowtransparency="true"></iframe>
</body>
</html>
子页面
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>子页面</title>
<style type="text/css">
body
{
background-color: transparent;
}
</style>
</head>
<body>
</body>
</html>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
整理高度塌陷与BFC
当面试官问道你高度塌陷时,人们第一想到的方法一定是 .clearfix::after { content: ''; display: b...
[阅读全文]
-
-
-
-
-
使用CSS完成商城首页的优化
使用CSS完成网站首页的优化 需求分析 由于我们昨天使用表格布局存在缺陷,那么我们要来考虑使用DIV+CSS来对页面进行优化 表格布局的缺陷 1. 嵌套...
[阅读全文]
-
使用CSS完成注册界面的优化
使用DIV+CSS完成注册页面的优化 需求分析 由于我们的注册页面也是用table布局的,存在与首页同样的问题,所以我们需要使用div+css对我们的注...
[阅读全文]
-
-
网友评论