框架页文件设置:
<body style="background-color:transparent" > 或 <body bgColor="transparent">
方法一:
<iframe src="about.htm" width="100%" height="100%" align="center" scrolling="auto" frameborder="0" style="filter:chroma(color=#ffffff)" >
</iframe>
缺点:iFrame里的白色的都变透明了。
方法二:(个人推荐使用)
<iframe src="about.htm" width="100%" height="100%" align="center" scrolling="auto" frameborder="0" allowTransparency="true" >
</iframe>
还有其它几个写法,可以比较一下:
<iframe src="about.htm" allowTransparency="true" style="background-color: green"> </iframe >
<iframe src="about.htm"> </iframe >
<iframe src="about.htm" style="background-color: green"> </iframe >
被这个问题卡了一天,除了IE 别的浏览器(opera firefox safari chrome)都解决了
a.html嵌入一个b.html
---------------------
a.html---------
<body>
<div id="main" >
<iframe name="header" src="b.html" mce_src="a.html" frameborder="0" scrolling="no" align="top" marginheight="0" marginwidth="0" width="992" height="106"></iframe>
</div>
</body>
---------------------------------
b.html---
<body style="background:transparent;">
<div id="main" >
<iframe name="header" src="a.html" mce_src="a.html" frameborder="0" scrolling="no" align="top" marginheight="0" marginwidth="0" width="992" height="106"></iframe>
</div>
</body>
只要在b.html页面的<body>设置样式就OK了
<body style="background:transparent;">