2013-10-17 136 views
0

我有一个图像和图像包装内的覆盖。将鼠标悬停在包装上会导致覆盖图从透明度0变为0.8。它适用于所有浏览器,但IE。我相信我正在使用不透明度的正确IE过滤器。请看一看的代码:IE悬停问题与图像覆盖

HTML

<div class="img-wrap"> 
    <img class="profile" src="images/z.jpg"> 
    <a href="team-employee-z.html" class="img-overlay team"> </a> 
</div> 

CSS

.img-wrap { 
    margin-right: 3px; 
    float: left; 
    height: 100%; 
    overflow: hidden; 
    position: relative; 
    width: 250px; 
} 

.img-overlay { 
    text-decoration: none; 
    display: none; 
    height: 100%; 
    background-color: #000; 
    color: #fff; 
    opacity: 0; 
    filter: alpha(opacity = 0); 
    position: absolute; 
    width: 100%; 
    z-index: 100; 
} 

.img-overlay.team { 
    top: 0; 
} 

.img-wrap:hover .img-overlay { 
    display: block; 
    opacity: 0.80; 
    filter: alpha(opacity = 80); 
    transition: opacity 0.25s; 
    -moz-transition: opacity 0.25s; 
    -webkit-transition: opacity 0.25s; 
} 
+0

IE有许多版本 - 最好指定你关心的人。 –

+0

也许您必须在'.img-wrap:hover'中重置正确的过滤器。尝试:'-ms-filter:“”;' –

回答

0

-MS-滤波器: “的progid:DXImageTransform.Microsoft.Alpha(不透明度= 50)”;

此过滤器应该适用于ie 7-8

+0

谢谢,但问题是在所有IE版本(包括9/10) – user2864202

+0

你仍然可以尝试这个过滤器,因为无论如何你都会需要它。您可以尝试删除所有额外的过滤器行并获得基本工作。 – teemo