簡體   English   中英

IE7和IE8中不顯示背景圖像

[英]Background image doesn't show in IE7 and IE8

在我的網站http://aspspider.info/thesamy/GalleriesTest/MainPage/Main.aspx (免費托管測試),我有2個背景圖像。 在每個瀏覽器中工作的主體和在IE7,IE8中不起作用的內容包裝器。

我無法理解為什么,如果身體的背景img顯示,為什么它在頁面上的不同區域不起作用?

這是該地區的HTML代碼:

   <div id="Content-wrapper">

        <div id="GalleriesContent">
            <iframe scrolling="no" id="iframeBoxID" frameborder="0" class="iframeBoxClass" name="iframeBox"
                src="http://www.google.com"></iframe>
        </div>

    </div>

這是css:

#Content-wrapper
{
    /*background-image:url('../logo/blackBackGround2.png'); <-- tired that*/
      background-image:url(../logo/blackBackGround2.png);

}

#GalleriesContent
{
    background-color:transparent;
    clear: both;
}
.iframeBoxClass
{
     background-color:transparent;
    border: 1px solid white;
    width: 100%;
    height: 550px;
}

無論出於什么神奇的原因,IE渲染具有白色背景的iframe,並且必須被告知要顯式渲染透明背景以便顯示div背景。 這種行為被詳細這里和修復非常簡單,只需將以下屬性添加到您的iframe標簽,它應該解決這個問題:

allowTransparency="true"

e.g.

<iframe allowTransparency="true"></iframe>

嘗試在CSS中添加背景重復

background-repeat: repeat-y;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM