【问题标题】:How to remove png transparency from iframe coming in my wordpress site如何从我的 wordpress 网站中的 iframe 中删除 png 透明度
【发布时间】:2012-07-03 05:57:09
【问题描述】:

白色背景环绕着我的 iframe,因为我正在从数据库中呼应这个 iframe,尽管它在除 IE8、IE9 之外的所有其他浏览器中都能正确显示(请检查屏幕截图)。虽然我在 header.php 中尝试了这个脚本,因为站点位于 wordpress 上,但仍然没有运气(在 js 文件夹下包含 ie6pngfix.js)。让我知道我该如何解决这个问题。

<!--[if IE 6]>
<script type="text/javascript" src="js/ie6pngfix.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('img, ul, ol, li, div, p, a, h1, h2, h3, h4, h5, h6, png, span');
</script>
<![endif]--> 

详情如下--

<div id="banner_right">
<iframe width="483" height="300" src="http://www.youtube.com/embed/EDPYq4BFHBI" frameborder="0" allowfullscreen></iframe>       
</div>

#banner_right iframe{background:url(images/bg.png) 0 0 no-repeat;padding: 20px 13px 27px;}

bg.png 属于510X351 px

正确的屏幕截图,除 IE8-9 之外的所有内容——(无白色背景)

屏幕截图不正确,IE8-9 --(带白色背景)

【问题讨论】:

标签: css image wordpress iframe transparency


【解决方案1】:

自己找到答案 --

allowtransparency="true" 添加到 iframe 代码。

<iframe width="483" height="300" src="http://www.youtube.com/embed/EDPYq4BFHBI" frameborder="0" allowtransparency="true"></iframe>

然后将background-color:transparent;添加到我的css--

#banner_right iframe{background:url(images/bg.png) 0 0 no-repeat;padding: 20px 13px 27px; background-color:transparent; }

【讨论】:

  • 您可以压缩该规则并在后台简写符号中包含background-colorbackground: transparent url(images/bg.png) 0 0 no-repeat;
  • @steveax 非常感谢兄弟的信息..css 有点弱..有时真的很挣扎:(
猜你喜欢
  • 2015-01-11
  • 1970-01-01
  • 2014-12-02
  • 2017-08-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-31
  • 1970-01-01
相关资源
最近更新 更多