samy
samy

Reputation: 1969

Background image doesn't show in IE7 and IE8

On my site http://aspspider.info/thesamy/GalleriesTest/MainPage/Main.aspx (free hosting for test), I have 2 background images. The body that works in every browser and a content-wrapper that doesn't work in IE7, IE8.

I can't understand why, if the background img of the body shows, why it doesn't work in different areas on the page?

This is the HTML code of the area:

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

and here is the 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;
}

Upvotes: 1

Views: 4599

Answers (1)

Andres I Perez
Andres I Perez

Reputation: 75379

For whatever magical reason IE renders iframes with a white background and has to be told to explicitly render a transparent background in order for your div background to show. That behavior is detailed here and the fix is quite simple, simply add the following attribute to your iframe tag and it should fix the issue:

allowTransparency="true"

e.g.

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

Upvotes: 2

Related Questions