views:

862

answers:

4

I am able to create an iframe which occupies entire screen. But I am not able to make the contents of the background hidden, In other words, I want an iframe which is opaque. I am currently trying like this:

   <iframe name='myifrmae' allowtransparency = 'false' background= '#FFFFFF' id = 'myiframe' src = 'main.html' style='position:absolute;top:0px;left:0px;width:400px;height:100%;z-index:999' onload = 'sendParams();'' frameborder='no'></iframe>

I am testing this on Firefox/3.5.6.

Am I doing anything wrong here?

UPDATE: I gave a BGCOLOR = "#FFFFFF" to main.html body, Now it is working fine. Thanks for your inputs!

+1  A: 

Why not use an opaque div with an iframe in it?

matpol
Actually this iframe is under a div, but let me check how to make this opaque.
Manohar
A: 
allowtransparency = 'false'

Doesn't sound like a very good start?

Try setting allowtransparency = 'true'

And then make sure that the content inside the iframe has it's opacity set to be transparent.

Andrew M
I dont want to allowtransparency, thats why I have made it as false. I want to load a fullscreen opaque iframe, which overlaps on the parent content.
Manohar
Fair enough, I got the wrong end of the stick, sorry.
Andrew M
A: 

Full screen iFrame you would need to add margin:auto; to your styles.

Joshua
+2  A: 

Try:

<iframe name='myiframe' id='myiframe' src='main.html' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:999' onload='sendParams();' frameborder='no'></iframe>

You don't need to set allowtransparency=false as this is the default. Also there were a few errors with extra quotes. Also I've corrected the spelling the name attribute.

I've changed the width to be 100% instead of the fixed width of 400 pixels to make sure that it fills the entire window.

Camsoft
I just tried this. It does occupy 100% but still I can see the contents of the parent HTML. I want to make this opaque, thanks for your quick reply.
Manohar
Can you supply the HTML of some example HTML for the parent page and possibly the main.html page too. I can't see a single reason in the example code provided for the iframe to be transparent.Do you have any JavaScript or CSS that might be manipulating the iframe's opacity settings?
Camsoft
I checked in a sample, It behaves as you have explained above. But the behavior is not same in my application. Yes, there is some rogue CSS responsible for this behavior, thanks for pointing it out. I will check this out and update the findings.
Manohar