views:

111

answers:

1

Hi,

Is it possible to style an iframe with a background colour within MS IE6?

If so, how?

Thanks. Tony.

+3  A: 

You can do it programatically from the "parent" page with Javsacript like this...

window.frames["frameName"].document.body.style.backgroundColor = "green";

In order for this to work, however, the page within the frame has to sit on the same domain as the parent.

Josh Stodola
and this will work in IE6 as well?
tonsils
Of course. Have you tried it?
Josh Stodola
Hi Josh, tried it but all that seems to happen is that the iframe border changes to green and not the whole background.
tonsils
All good - thanks Josh.
tonsils