在页面中嵌套另一个页面是很常见的。
但是如果主页面的背景是一个图片,这个时候用<iframe 的话,会发现嵌套的地方背景被挖了一块。
怎样让嵌套的那个页面透明呢?
1。在<body>标签中,加入style="background-color=transparent" (注意:是被嵌套的那个页面加,就是<iframe src="http://www.liaoni.com/xxx.htm" ...> 的这个 xxx.htm 加)
2。通过以下四种IFRAME的写法实现对iframe背景透明效果:
<IFRAME ID="Frame1" SRC="http://www.liaoni.com/abc.htm" allowTransparency="true"></IFRAME>
<IFRAME ID="Frame2" SRC="#" allowTransparency="true" STYLE="background-color: green"> </IFRAME>
<IFRAME ID="Frame3" SRC="#"></IFRAME>
<IFRAME ID="Frame4" SRC="#" STYLE="background-color: green"> </IFRAME>