<分区>
<分区>
Possible Duplicate:
Can I change or control the color of the IFRAME area before the content loads?
我在 div 中有一个带有背景色的 iframe。加载页面时,iframe 占位符变为白色。有什么方法可以在加载 iframe 时更改背景?
提前谢谢你。
最佳答案
也许是这样
<iframe src="http://www.google.com/" width="500" height="400" style="background-color: red;"></iframe>
有用吗?
您还可以为 iFrame 指定一个类或 ID,并为其指定 CSS 样式。
对于图像:
<iframe src="http://www.google.com/" width="500" height="400" style="background-image: url('http://www.google.co.uk/intl/en_uk/images/logo.gif');"></iframe>
关于html - 加载时更改 iframe 的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2714251/