CSS给框架定义背景

框架页文件设置:

 

<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 >

原文地址:https://www.cnblogs.com/yeminglong/p/2212949.html