Search code examples
htmlcssinternet-explorer-8lessmixins

Most elegant way to make RGBa Browser Support for IE8 by using LESS


I am using less in order to make a div with a background colour transparent.

Here is my code which does not work for IE8:

background-color: fade(@mycolor, @transparency);

My question is:
what is the best way, since I am using less, to get the same effect on IE8?


Solution

  • I don't know about LESS, but you can achieve alpha transparency in IE 7+8 by using a MS gradient filter and set the same color as start and end. The alpha channel is the first two hex digits, RGB following:

    /* ARGB backgrounds for IE 7+8 (white background with nearly 90% transparancy) */
    section {
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF );
        -ms-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF );
    }