html - 如何在 ie 9-11 中给 iframe 设置不透明度

标签 html css internet-explorer iframe

我给 li 标签设置了不透明度,悬停时不透明度为 1。在 chrome 中,mozilla 不透明度是可以的。但在 ie 9-11 中没有不透明度。我试图将 div 放在其中的绝对位置但没有成功,还尝试将 background-color:transparent 给 iframe 但再次没有成功。这是我的 html 代码:

<ul>
    <li>
        <iframe src="https://www.youtube.com/embed/QALRgeSoZRs" width="300" height="150" allowfullscreen="allowfullscreen"></iframe>                
    </li>
</ul>

这是CSS代码:

.video_list ul li {
  float: left;
  width: 48%;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  transition: all 0.5s;
  opacity: 0.7;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
  filter: alpha(opacity=70);
  -moz-opacity: 0.7;
  -khtml-opacity: 0.7;
  margin-bottom: 27px;
  position: relative;
}

最佳答案

我找到了一个解决方案,也许这对其他人有用

这是我更新后的代码:

<iframe style="background: transparent;" src="https://www.youtube.com/embed/QALRgeSoZRs?wmode=transparent" width="300" height="150" allowfullscreen="allowfullscreen"></iframe>

刚刚添加了?wmode=transparent这个参数。

但现在有一个问题,悬停时无法消除透明度,有人可以对此提出任何建议吗?

关于html - 如何在 ie 9-11 中给 iframe 设置不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29466893/

相关文章:

javascript - 如何根据条件更改输入类型 ="range"=> 步长值?

jquery - 固定定位不起作用

internet-explorer - spring AbstractExcelView 和 IE

javascript - 通用的 createPopup() 替代品?

internet-explorer - 跨浏览器插件

html - 我应该为 Firefox html5 下载属性使用什么 S3 cors 配置?

html - 如何禁用IE中的文件输入文本框?

java - 生成图像的 base64 字符串以在数据 URI 中使用

html - 如何防止 SVG 图像周围出现 CSS 背景颜色 "bleed"?

javascript - 如何在 2 个 SVG 之间交替转换