Created
May 9, 2012 12:35
-
-
Save alanshaw/2644213 to your computer and use it in GitHub Desktop.
LESS CSS class for cross browser opacity
This file contains 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
.opacity(@opacity) { | |
@ieOpacity: @opacity * 100; | |
// If you don't use this order, IE8-as-IE7 doesn't apply the opacity, although IE8 and a pure IE7 do. | |
// http://www.quirksmode.org/css/opacity.html | |
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{ieOpacity})"; // IE 8 | |
filter: ~"alpha(opacity=@{ieOpacity})"; // IE 5-7 | |
opacity: @opacity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment