【问题标题】:IFrame background transparent in IEIE中的IFrame背景透明
【发布时间】:2011-07-05 06:36:38
【问题描述】:

所以我有这个带有 .transparentbg 类的 iFrame:

.transparantbg{
    background-color: transparent;
}

这在 Chrome 中可以正常工作,但在 IE 中不行...

请帮忙?

问候

【问题讨论】:

标签: html css internet-explorer iframe transparent


【解决方案1】:

将 allowTransparency="true" 添加到您的 iframe

<IFRAME ID="Frame1" SRC="whatever.htm" allowTransparency="true">

对于whatever.htm,将background:transparent 添加到其body 标记中。

<body style="background:transparent">

【讨论】:

  • 太棒了!这非常适合 IE8,但我仍然遇到 IE7 的问题,它仍然显示白色背景而不是透明的任何想法。??...
  • 是的,请接受这样一个事实,即极少数用户会看到白色背景而不是透明背景。
  • 啊,两天后,我找到了这个解决方案。非常感谢你们俩
  • 如果有人看到进一步的问题,我发现在 IE8 中,当现有 iframe 更改其源时,其中的 html 标记也必须设置样式。
  • 出现 IE9 不需要allowTransparency="true" 部分。
猜你喜欢
  • 2021-09-20
  • 2010-11-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-05
  • 1970-01-01
相关资源
最近更新 更多