Last active
December 14, 2015 19:59
-
-
Save berend-de-jong/5140930 to your computer and use it in GitHub Desktop.
CSS: opacity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zoom: 1; | |
| -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; | |
| filter: alpha(opacity=50); | |
| -moz-opacity: 0.5; | |
| -khtml-opacity: 0.5; | |
| opacity: 0.5; |
Author
Author
As a sass mixin:
@mixin opacity($opacity){
$opacity_ie: $opacity * 100;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=$opacity_ie)";
filter: alpha(opacity=$opacity_ie);
-moz-opacity: $opacity;
-khtml-opacity: $opacity;
opacity: $opacity;
}
@include opacity(0.5);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For IE, make sure the element has layout. Set a width / height or zoom: 1