Wednesday, December 12, 2012

Cross Browser Opacity Classes

These come in handy pretty often:

.no_opacity {
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE 8 */
    filter: alpha(opacity=0); /* IE 5-7 */
    -moz-opacity: 0.0;  /* Netscape */
    -khtml-opacity: 0.0; /* Safari 1.x */
    opacity: 0.0; /* Good browsers */
}
.half_opacity {
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 8 */
    filter: alpha(opacity=50); /* IE 5-7 */
    -moz-opacity: 0.5;  /* Netscape */
    -khtml-opacity: 0.5; /* Safari 1.x */
    opacity: 0.5; /* Good browsers */
}
.full_opacity {
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; /* IE 8 */
    filter: alpha(opacity=100); /* IE 5-7 */
    -moz-opacity: 1.0;  /* Netscape */
    -khtml-opacity: 1.0; /* Safari 1.x */
    opacity: 1.0; /* Good browsers */
}

No comments:

Post a Comment