Default background color of IFRAME

J

Julian

How can you set the background color of an IFRAME, before its contents
appear?

I know that an IFRAME must set its styles or use a style sheet of its
own. My problem is that I have an IFRAME whose content is generated by a
CGI script. It takes a couple of seconds to appear.

My page has a colored background. Firefox paints the IFRAME with the
background-color specified for the body. But in Internet Explorer the
IFRAME initially appears as an ugly white box, until the content appears.
 
G

Greg N.

Julian said:
How can you set the background color of an IFRAME, before its contents
appear?


The "allowtransparency" parameter makes the iframe assume the background
color of the surrounding page. See if that helps.
<IFRAME src=... allowtransparency>
 
J

Julian

Greg said:
The "allowtransparency" parameter makes the iframe assume the background
color of the surrounding page. See if that helps.
<IFRAME src=... allowtransparency>

That seems to do it, Greg. Thanks!
 
Joined
Jun 17, 2009
Messages
1
Reaction score
0
Thanks Greg

Thanks so much Greg for this solution, it worked. I've been looking into how to change the iframe background color because the iframe appears on certain condition only so when it doesn't , it leaves that white box. All the developers I work with told me it's not going to work in Internet Explorer. They just didn't want to bother looking for a solution I guess. Thanks again :veryprou:
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top