iframe透明设置

发布时间:2025-12-09 17:29:54 浏览次数:4

除了IE之外的其他浏览器,默认情况下IFrame都是透明的。但IE下默认是白色背景的。那么,如何让IE下的IFrame也能透明呢?
1.我们就需要用到一个特殊的特性了:

allowtransparency="true"

eg.

<iframe id="1" frameborder="0" scrolling="no" width="780" height="55" src="" allowtransparency="true"></iframe>

 这个属性可以将iframe设置为透明。

2.在嵌入IFrame中的页面上要加上:

<body style="background-color:transparent">

 这样将嵌入的网页的背景设成透明。

这样就设置好了

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477