Iframe transparent background

Solution 1:

I've used this creating an IFrame through Javascript and it worked for me:

// IFrame points to the IFrame element, obviously
IFrame.src = 'about: blank';
IFrame.style.backgroundColor = "transparent";
IFrame.frameBorder = "0";
IFrame.allowTransparency="true";

Not sure if it makes any difference, but I set those properties before adding the IFrame to the DOM. After adding it to the DOM, I set its src to the real URL.

Solution 2:

<style type="text/css">
body {background:none transparent;
}
</style>

that might work (if you put in the iframe) along with

<iframe src="stuff.htm" allowtransparency="true">

Solution 3:

Set the background color of the source page to none and allow transparency in the iframe element.

Source page (for example, source.html):

<style type="text/css">
    body
    {
        background:none transparent;
    }
</style>

Page with iframe:

<iframe src="source.html" allowtransparency="true">Error, iFrame failed to load.</iframe>