Posted By

viatropos on 08/12/10


Tagged

css html opacity browser stylesheet SASS cross scss


Versions (?)

Cross Browser CSS Opacity (with and without Sass)


 / Published in: CSS
 

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

  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. }

Report this snippet  

You need to login to post a comment.