The correct way to make an iFrame transparent is to set a special attribute for the iFrame element then making the second document’s body transparent using CSS. The iFrame attribute is allowtransparency. If it’s set to be true, the iFrame will be transparent, else will be a static color, white by default.
Let’s see an example. First, we have to make the document we want to mirror transparent. This can be achieved with CSS, by putting the following code in the head section of the document:
Code:
<style type="text/css" media="all">
body {
background-color: transparent;
}
<style>
Now in the document you want the iFrame to appear, create an iFrame and make sure the allowtransparency=”true” attribute is set. Like this:
Code:
<iframe src="seconddocument.html" allowtransparency="true" >
</iframe>
Bookmarks