css - IE8 - 带有不透明度的 div 中的圆 Angular

标签 css internet-explorer-8 pie-chart

我在 IE8 中使用过滤器使 div 背景透明:

-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";

当我想做圆 Angular 的时候我找到了PIE.htc with css

-webkit-border-radius: 10px; 
-moz-border-radius: 10px; 
border-radius:10px; 
-ms-behavior: url('./../css/PIE.htc');
behavior: url('./../css/PIE.htc');

但是当我尝试组合这段代码时,我得到了带有圆 Angular 但没有不透明度的元素。这是我的元素的完整 CSS 代码:

#frontpage .form_wrapper .form_background{
width:100%; 
height: 100%;
position: absolute;
z-index: 1; 
opacity: 0.7; 
background-color: #ffffff; 
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; 
-webkit-border-radius: 10px; 
-moz-border-radius: 10px; 
border-radius:10px; 
-ms-behavior: url('./../css/PIE.htc');
behavior: url('./../css/PIE.htc');}

有可能吗?


更新

感谢您的回答。 我遇到了一个问题:

-pie-background:rgba(255,255,255,.7);

在除 IE 之外的任何其他浏览器中均无效。所以,我不得不只为 IE8 包含它。这是我的解决方案,也许它可以帮助某人。 HTML 文件:

 <!--[if lte IE 8]><div class="IE IE8andLower form_background rounded_corners"></div><![endif]-->
 <!--[if gt IE 8]><div class="IE IE8higher form_background rounded_corners"></div><![endif]-->
 <!--[if !IE]>--><div class="notIE form_background rounded_corners"></div><!--<![endif]-->

以及对应的CSS规则:

#frontpage .form_wrapper .form_background{
    width:100%; 
    height: 100%; 
    position: absolute; 
    z-index: 1; 
    opacity: 0.7; 
    -webkit-border-radius: 10px; 
    -moz-border-radius: 10px; 
    border-radius:10px;
 }

#frontpage .form_wrapper .form_background.notIE,#frontpage .form_wrapper .form_background.IE.IE8higher {
    background-color: #ffffff
 }

#frontpage .form_wrapper .form_background.IE.IE8andLower{ 
    -pie-background:rgba(255,255,255,.7); 
    behavior: url('./../css/PIE.htc');
 }

最佳答案

你不能有 ms 过滤器和不透明度,但你可以使用 css pie background 属性来获得 rgba 值:

-pie-background:rgba(255,255,255,.7);

只需删除背景颜色:#fff

关于css - IE8 - 带有不透明度的 div 中的圆 Angular ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21308686/

相关文章:

css - 从 node_modules 到 angular-cli 的自定义字体

html - 使用显示: inline-block; HTML CSS时出现添加框

css - IE8水平滚动条问题

jquery - 为什么动态添加列表项在 Chrome 和 Firefox 中有效,但在 IE8 中无效?

JQuery float 饼图大小错误

d3.js - 在 dc.js + labelColors 中向饼图切片添加边框

javascript - 如何将 PHP 和 CSS 的条件与 JavaScript 结合起来

javascript - ng-repeat 为每一行设置随机颜色

javascript - Facebook 连接使用 IE8 导致问题;任何解决方法?

javascript - Highcharts饼图如何减少由于绘图宽度造成的图表和图例之间的空间