On Apr 14, 2009, at 8:26 AM, David Hucklesby wrote:
>> How do I set the opacity of a <div> to let's say 50%
>>
> DIV, or DIV background? If the latter, here's my (partial) solution
> for 25%:
>
> .aside {
> background: url(images/argb44452713.png);
> *background: transparent;
>
> filter:progid:DXImageTransform
> .Microsoft.gradient(startColorstr=#44452713,endColorstr=#44452713);
> /*AARRGGBB*/
> background: rgba(45, 27, 13, .25);
> }
>
> The semi-transparent PNG is for pre-CSS3 browsers, with the
> exception of
> IE, which gets its proprietary gradient filter. Browsers that handle
> RGBA use the last declaration-- the rest ignore it.
>
> The *background: transparent; nullifies the background-image in
> IE 5,6,7. If I knew how to do the same for IE 8 I'd use this filter:
>
> -ms-
> filter
> :"progid:DXImageTransform
> .Microsoft.gradient(startColorstr=#44452713,endColorstr=#44452713)";
I wouldn't use that -ms- filter, except for iE 6, maybe. IE 7 +
supports transparent PNG's just fine. The -ms- filter has some
unwanted side effects, one of which is to make fonts look cr*p, more
so with cleartype turned on. Besides, those -ms- filters require
'hasLayout' to be true to make them work, which can have negative side
effects on its own.
Philippe
---
Philippe Wittenbergh
http://l-c-n.com/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/