Monday, June 9, 2008

Links don't work in IE6 while filter:progid:DXImageTransform.Microsoft.AlphaImageLoader is set

THE PROBLEM
All of the link within a div which has css property

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');

set seems inactive in Internet Explorer 6. If you simply comment this property, IE6 will give you back the usual rendering.



THE SOLUTION
This problem seems quite hard to be solved, and many articles has benn written about it, but as a matter of fact the simplest css hack is all you need to fix it: you simply need to declare

position:relative;

in a pseduo-class selector to get all of your contents work properly!



A WORKING CODE EXAMPLE
<html>
  <head>
    <style>

      a, a:visited, a:hover, a:visited:hover
      {
        text-decoration:none;
        color:#848484;
        position:relative;
      }

      #wrapper
      {
        filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');
      }

    </style>
  </head>
  <body>
    <div id="wrapper">
      <a href="#"></a>
    </div>
  </body>
</html>

No comments: