Cross Browser CSS Opacity (with and without Sass)


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // css
  2. .opacity {
  3. opacity: .80;
  4. filter: alpha(opacity=80);
  5. -ms-filter: "alpha(opacity=$value)";
  6. -khtml-opacity: .80;
  7. -moz-opacity: .80;
  8. }
  9.  
  10. // sass
  11. @mixin opacity($value) {
  12. opacity: #{"." + $value};
  13. filter: alpha(opacity=$value);
  14. -ms-filter: "alpha(opacity=$value)";
  15. -khtml-opacity: #{"." + $value};
  16. -moz-opacity: #{"." + $value};
  17. }
  18.  
  19. .opacity {
  20. @include opacity(80);
  21. }

URL: cross-browser-css-opacity-with-and-without-sass-

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.