Forum Moderators: mack

Message Too Old, No Replies

iframe backgrounds

background color for iframes

         

ciaranclissmann

10:09 pm on Jan 26, 2006 (gmt 0)



I had a real problem dealing with an empty iframe in a page with a strong background colour - it looked like a white square. What I wanted was to use a select pulldown to populate the iframe, based on the user choice. Snag - until a choice is made, the iframe is empty and ugly.

Tried various things with transparency, bgcolor, style="background-color:..." and so on. Nothing worked.

What works for me is, on teh page with the iframe

<BODY onLoad="document.iframe1.location='blur.html'">

where blur.html is a one-line html file which simply fills the screen with the background colour that you want the iframe to have.

Once the user makes a choice, this content of the iframe is discarded, so that's cool.

tedster

10:58 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Only works for browsers with Javascript active -- but sounds like a solution for 9 out of 10 visitors or so. Any reason not to make blur.html the src= page in the iframe tag?