Do I really need all these CSS Opacity Properties? I’m not using ALL of these at once, but showing them at different percentages. But I usually have the group of 4 and I wanted to see if I can eliminate anything from my stylesheet.
And can someone show me an example of 100%, 25%, and 0%? I want to make sure I have them done correctly.
opacity: 1;
-moz-opacity: 1;
filter:alpha(opacity=1);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
opacity: 0.25;
-moz-opacity: 0.25;
filter:alpha(opacity=0.25);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=25)";
opacity: 0;
-moz-opacity: 0;
filter:alpha(opacity=0);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
If you want CSS3 opacity across as many browsers as possible, you’ll need all of these properties:
However, you can cut most of those for modern usage:
Note that while IE 8 support
filter, it’s not the recommended way to add opacity. However, it all works the same.