IE中的不透明度= S.

时间:2011-02-07 17:56:11

标签: css internet-explorer jquery-ui filter opacity

我看了其他问题,但仍然无法弄明白。

修改 这是一个HTML页面,它重现了我的错误:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN"><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<HTML>
<HEAD><STYLE> 
HTML
{
    min-height: 0px;
    font-size: 100%;
}
BODY
{
    min-height: 0px;
    font-size: 100%;
}
DIV
{
    min-height: 0px;
    font-size: 100%;
}
HTML
{
    padding-bottom: 0px;
    margin: 0px;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 0px;
}
BODY
{
    padding-bottom: 0px;
    margin: 0px;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 0px;
}
BODY
{
    position: relative;
    min-width: 100%;
    background-color: #333;
    margin: 0px;
    display: inline-block;
    font-family: Arial, Sans-Serif;
    height: 100%;
    font-size: 12px;
}
#abc_content
{
    border-bottom: #666 2px solid;
    border-left: #666 0px solid;
    padding-bottom: 5px;
    background-color: #fff;
    padding-left: 5px;
    padding-right: 5px;
    border-top: #666 2px solid;
    border-right: #666 0px solid;
    padding-top: 5px;
}
#abc_leftbar + #abc_content
{
    margin-left: 210px;
}
.ui-helper-clearfix:after
{
    display: block;
    height: 0px;
    visibility: hidden;
    clear: both;
    content: ".";
}
.ui-helper-clearfix
{
    display: inline-block;
}
.ui-helper-clearfix
{
    display: block;
}
.ui-state-disabled
{
    cursor: default !important;
}
.ui-widget-header
{
    background: #176000;
    color: #ffffff;
}
.ui-state-default
{
    border-bottom: #176000 1px solid;
    border-left: #176000 1px solid;
    background-color: #458b11;
    color: #ffffff;
    border-top: #176000 1px solid;
    border-right: #176000 1px solid;
}
.ui-widget-header .ui-state-default
{
    border-bottom: #176000 1px solid;
    border-left: #176000 1px solid;
    background-color: #458b11;
    color: #ffffff;
    border-top: #176000 1px solid;
    border-right: #176000 1px solid;
}
.ui-state-disabled
{
    filter: alpha(opacity=75); opacity: .75;
    -moz-opacity: .75;
    -khtml-opacity: .75;
}
.ui-corner-tl
{
    -moz-border-radius-topleft: 10px;
    -webkit-border-top-left-radius: 10px;
    border-top-left-radius: 10px;
}
.ui-corner-tr
{
    -moz-border-radius-topright: 10px;
    -webkit-border-top-right-radius: 10px;
    border-top-right-radius: 10px;
}
.ui-corner-bl
{
    -moz-border-radius-bottomleft: 10px;
    -webkit-border-bottom-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.paging_full_numbers .ui-button
{
    padding-bottom: 2px;
    margin: 0px;
    padding-left: 6px;
    padding-right: 6px;
    cursor: pointer;
    padding-top: 2px;
}
.ui-buttonset .ui-button
{
    margin-right: -0.1em !important;
}
.paging_full_numbers
{
    width: 350px !important;
}
.ui-toolbar
{
    position: relative;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    zoom: 1;
    height: 20px;
    padding-top: 5px;
}
.dataTables_paginate
{
    width: auto;
}
.dataTables_wrapper
{
    font-family: Arial, Sans-Serif;
    max-width: 100%;
    font-size: 120%;
    font-weight: bold;
}
.dataTables_wrapper
{
    position: relative;
    min-height: 302px;
    clear: both;
    _height: 302px;
}
.dataTables_paginate
{
    text-align: right;
    line-height: 20px;
    float: right;
    height: 20px;
}

</STYLE></HEAD>
<BODY><DIV id="abc_content"><DIV id="dd_table_wrapper" class="dataTables_wrapper"><DIV class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"><DIV id="dd_table_paginate" class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers">

<SPAN id="dd_table_first" class="first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default ui-state-disabled" jQuery1297179778124="2">First</SPAN>

</DIV></DIV></DIV></DIV></BODY></HTML>

适用于FF和Chrome,但不适用于IE(我使用的是IE 8)。

有什么想法吗?谢谢!

4 个答案:

答案 0 :(得分:5)

您需要在IE 8中设置-ms-filter

opacity: .70; /* Standard: FF gt 1.5, Opera, Safari */
filter: alpha(opacity=70); /* IE lt 8 */
-ms-filter: "alpha(opacity=70)"; /* IE 8 */
-khtml-opacity: .70; /* Safari 1.x */
-moz-opacity: .70; /* FF lt 1.5, Netscape */

答案 1 :(得分:1)

IE8不支持不透明度 - 您可以改用MS的渐变滤镜:

.className{
opacity: 0.7; 
-ms-filter: "alpha (opacity=70)"; 
filter: alpha (opacity=70);
} 

答案 2 :(得分:1)

我只是改变了颜色,使它看起来像我正在改变不透明度。 IE失败......

答案 3 :(得分:0)

尝试使用:

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