No replies
tswaters's picture
Last seen: 11 years 2 days ago
Timezone: GMT-8
Joined: 2010-01-22
Posts: 2
Points: 3

I saw a topic posted on this and found there was no answer and a locked topic, so here's the problem in a nutshell. When you have padding around an iframe, the background color doesn't appear like it should in IE7.

Here's an example:

parent page:
<html><body style="background-color:white">
<iframe style="padding:5px; border:1px solid black; background-color:red;" src="mypage.htm" />
<html><body style="background-color:green;"></body></html>

You might expect the iframe to appear green, with 5px of red around it, and a 1px border around that.... as you see in most major browsers. However, taking a look at IE7, you may see that the colouring is not as expected, the padding is the same as the background colour of the parent's body (in this case white).

The resolution (as painful as it may be) is to add AllowTransparency="true" to the iframe
Here's the related MSDN article: