2012-07-03 37 views
0

白色背景是舍入我的iframe,因爲我從數據庫迴應這個iframe,雖然它在所有其他瀏覽器,除IE8,IE9(PLZ檢查屏幕截圖)正確顯示。儘管我在我的header.php中嘗試了這個腳本,因爲網站位於wordpress,但仍然沒有運氣(包括js文件夾下的ie6pngfix.js)。讓我知道我該如何解決這個問題。如何從iframe中刪除PNG透明度在我的WordPress站點

<!--[if IE 6]> 
<script type="text/javascript" src="js/ie6pngfix.js"></script> 
<script type="text/javascript"> 
DD_belatedPNG.fix('img, ul, ol, li, div, p, a, h1, h2, h3, h4, h5, h6, png, span'); 
</script> 
<![endif]--> 

詳情如下 -

<div id="banner_right"> 
<iframe width="483" height="300" src="http://www.youtube.com/embed/EDPYq4BFHBI" frameborder="0" allowfullscreen></iframe>  
</div> 

#banner_right iframe{background:url(images/bg.png) 0 0 no-repeat;padding: 20px 13px 27px;} 

bg.png510X351 PX

CORRECT截圖,在所有除IE8-9 - (無白色背景) enter image description here

不正確的屏幕,IE8-9 - (帶白底) 我自己

+0

http://code.google.com/p/ie7-js/ – SRN

回答

2

找到答案 -

添加allowtransparency="true"到iframe的代碼。

<iframe width="483" height="300" src="http://www.youtube.com/embed/EDPYq4BFHBI" frameborder="0" allowtransparency="true"></iframe> 

然後加入background-color:transparent;我css--

#banner_right iframe{background:url(images/bg.png) 0 0 no-repeat;padding: 20px 13px 27px; background-color:transparent; } 
+2

可以凝聚這條規則,包括'背景color'在後臺速記符號中:'background:transparent url(images/bg.png)0 0 no-repeat;' – steveax

+0

@steveax thx很多兄弟的信息..很弱,用css ..真有時候會奮鬥:( – swapnesh