What is the difference between “opacity” and “filter: opacity()”










17















Most of us know the simple opacity CSS rule, but recently I stumbled upon filter which can have opacity(amount) as it value - among other things. But what exactly is the difference between the two?










share|improve this question


























    17















    Most of us know the simple opacity CSS rule, but recently I stumbled upon filter which can have opacity(amount) as it value - among other things. But what exactly is the difference between the two?










    share|improve this question
























      17












      17








      17








      Most of us know the simple opacity CSS rule, but recently I stumbled upon filter which can have opacity(amount) as it value - among other things. But what exactly is the difference between the two?










      share|improve this question














      Most of us know the simple opacity CSS rule, but recently I stumbled upon filter which can have opacity(amount) as it value - among other things. But what exactly is the difference between the two?







      css3 transparency opacity






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 1 '13 at 8:25









      Bram VanroyBram Vanroy

      13k1361131




      13k1361131






















          2 Answers
          2






          active

          oldest

          votes


















          -1














          filter in CSS had some different runs, namely for FireFox and MSIE.




          In MSIE 5.5 on through 7, filter, also known as Alpha Filter, actually makes use of MSIE's DX Filter (no longer supported). However, in order to be more CSS2.1 compliant, in IE8 MS introduced -ms-filter to replace filter. The syntax is different in that the value of -ms-filter must be encased in quotes. Eventually, IE9 brought deprecation to this method and as of IE10, it is no longer used.




          Another interesting note here, if you're wanting full compatibility for older IE, then you must make sure use of filter and -ms-filter must be very specific. For example, the following does not work in IE8 running IE7 compat mode:





          element 
          filter: alpha(opacity=50);
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";





          -ms-filter must come before filter in order to get more out of older IE compatibility.Like so:



          element 
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
          filter: alpha(opacity=50);




          FireFox made use of filter as an experiment gone awry. I believe the original idea was to mock what IE was doing in using the Direct X engine. There was even a browser specific version, as there was for most browsers at one time. Eventually, HTML5/CSS3 announced use of the filter namespace and it now has a new purpose.




          As of CSS3, filter now has a whole new meaning! Firefox docs stay open as if they plan to expand on this, though I've yet to see it (however they do crash JS if your CSS is not to its liking now!). Webkit (which will probably become standard in next update to CSS3) has started to implement filter to the point you can almost "photoshop" images for your site!



          Since filter is changing so much, opacity would be the preferred method to use, however, as you can see, to be completely cross-browser compatible means being very thorough.




          Browser specific alternates:



          • -webkit-filter: filter(value);

          • -moz-filter: filter(value);

          • -o-filter: filter(value);

          • -ms-filter: "progid:DXCLASS.Object.Attr(value)";


          See Also:



          • What's compatible with opacity?


          • What's compatible with the newer filter?
            • keep in mind, not the same as Older IE's filter






          share|improve this answer




















          • 3





            I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

            – Matthias Burger
            Jan 5 '17 at 8:35











          • @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

            – SpYk3HH
            Jan 6 '17 at 17:27












          • So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

            – AdrienK
            Jan 18 '17 at 9:26












          • @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

            – SpYk3HH
            Jan 18 '17 at 14:20


















          0















          filter: opacity() applies transparency to the samples in the input image. The value of “amount” defines the proportion of the conversion.
          A value of 0% is completely transparent. A value of 100% leaves the
          input unchanged. Values between 0% and 100% are linear multipliers on
          the effect. This is equivalent to multiplying the input image samples
          by amount. If the “amount” parameter is missing, a value of 100% is
          used.



          filter: opacity() is similar to the more established opacity property; the difference is that with filters, some browsers provide
          hardware acceleration for better performance. Negative values are not
          allowed.




          Source: https://css-tricks.com/almanac/properties/f/filter/






          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>








          share|improve this answer























          • typo? u comparing filter: opacity() and filter: opacity()

            – Ivan
            2 days ago










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20310219%2fwhat-is-the-difference-between-opacity-and-filter-opacity%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          -1














          filter in CSS had some different runs, namely for FireFox and MSIE.




          In MSIE 5.5 on through 7, filter, also known as Alpha Filter, actually makes use of MSIE's DX Filter (no longer supported). However, in order to be more CSS2.1 compliant, in IE8 MS introduced -ms-filter to replace filter. The syntax is different in that the value of -ms-filter must be encased in quotes. Eventually, IE9 brought deprecation to this method and as of IE10, it is no longer used.




          Another interesting note here, if you're wanting full compatibility for older IE, then you must make sure use of filter and -ms-filter must be very specific. For example, the following does not work in IE8 running IE7 compat mode:





          element 
          filter: alpha(opacity=50);
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";





          -ms-filter must come before filter in order to get more out of older IE compatibility.Like so:



          element 
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
          filter: alpha(opacity=50);




          FireFox made use of filter as an experiment gone awry. I believe the original idea was to mock what IE was doing in using the Direct X engine. There was even a browser specific version, as there was for most browsers at one time. Eventually, HTML5/CSS3 announced use of the filter namespace and it now has a new purpose.




          As of CSS3, filter now has a whole new meaning! Firefox docs stay open as if they plan to expand on this, though I've yet to see it (however they do crash JS if your CSS is not to its liking now!). Webkit (which will probably become standard in next update to CSS3) has started to implement filter to the point you can almost "photoshop" images for your site!



          Since filter is changing so much, opacity would be the preferred method to use, however, as you can see, to be completely cross-browser compatible means being very thorough.




          Browser specific alternates:



          • -webkit-filter: filter(value);

          • -moz-filter: filter(value);

          • -o-filter: filter(value);

          • -ms-filter: "progid:DXCLASS.Object.Attr(value)";


          See Also:



          • What's compatible with opacity?


          • What's compatible with the newer filter?
            • keep in mind, not the same as Older IE's filter






          share|improve this answer




















          • 3





            I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

            – Matthias Burger
            Jan 5 '17 at 8:35











          • @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

            – SpYk3HH
            Jan 6 '17 at 17:27












          • So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

            – AdrienK
            Jan 18 '17 at 9:26












          • @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

            – SpYk3HH
            Jan 18 '17 at 14:20















          -1














          filter in CSS had some different runs, namely for FireFox and MSIE.




          In MSIE 5.5 on through 7, filter, also known as Alpha Filter, actually makes use of MSIE's DX Filter (no longer supported). However, in order to be more CSS2.1 compliant, in IE8 MS introduced -ms-filter to replace filter. The syntax is different in that the value of -ms-filter must be encased in quotes. Eventually, IE9 brought deprecation to this method and as of IE10, it is no longer used.




          Another interesting note here, if you're wanting full compatibility for older IE, then you must make sure use of filter and -ms-filter must be very specific. For example, the following does not work in IE8 running IE7 compat mode:





          element 
          filter: alpha(opacity=50);
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";





          -ms-filter must come before filter in order to get more out of older IE compatibility.Like so:



          element 
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
          filter: alpha(opacity=50);




          FireFox made use of filter as an experiment gone awry. I believe the original idea was to mock what IE was doing in using the Direct X engine. There was even a browser specific version, as there was for most browsers at one time. Eventually, HTML5/CSS3 announced use of the filter namespace and it now has a new purpose.




          As of CSS3, filter now has a whole new meaning! Firefox docs stay open as if they plan to expand on this, though I've yet to see it (however they do crash JS if your CSS is not to its liking now!). Webkit (which will probably become standard in next update to CSS3) has started to implement filter to the point you can almost "photoshop" images for your site!



          Since filter is changing so much, opacity would be the preferred method to use, however, as you can see, to be completely cross-browser compatible means being very thorough.




          Browser specific alternates:



          • -webkit-filter: filter(value);

          • -moz-filter: filter(value);

          • -o-filter: filter(value);

          • -ms-filter: "progid:DXCLASS.Object.Attr(value)";


          See Also:



          • What's compatible with opacity?


          • What's compatible with the newer filter?
            • keep in mind, not the same as Older IE's filter






          share|improve this answer




















          • 3





            I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

            – Matthias Burger
            Jan 5 '17 at 8:35











          • @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

            – SpYk3HH
            Jan 6 '17 at 17:27












          • So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

            – AdrienK
            Jan 18 '17 at 9:26












          • @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

            – SpYk3HH
            Jan 18 '17 at 14:20













          -1












          -1








          -1







          filter in CSS had some different runs, namely for FireFox and MSIE.




          In MSIE 5.5 on through 7, filter, also known as Alpha Filter, actually makes use of MSIE's DX Filter (no longer supported). However, in order to be more CSS2.1 compliant, in IE8 MS introduced -ms-filter to replace filter. The syntax is different in that the value of -ms-filter must be encased in quotes. Eventually, IE9 brought deprecation to this method and as of IE10, it is no longer used.




          Another interesting note here, if you're wanting full compatibility for older IE, then you must make sure use of filter and -ms-filter must be very specific. For example, the following does not work in IE8 running IE7 compat mode:





          element 
          filter: alpha(opacity=50);
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";





          -ms-filter must come before filter in order to get more out of older IE compatibility.Like so:



          element 
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
          filter: alpha(opacity=50);




          FireFox made use of filter as an experiment gone awry. I believe the original idea was to mock what IE was doing in using the Direct X engine. There was even a browser specific version, as there was for most browsers at one time. Eventually, HTML5/CSS3 announced use of the filter namespace and it now has a new purpose.




          As of CSS3, filter now has a whole new meaning! Firefox docs stay open as if they plan to expand on this, though I've yet to see it (however they do crash JS if your CSS is not to its liking now!). Webkit (which will probably become standard in next update to CSS3) has started to implement filter to the point you can almost "photoshop" images for your site!



          Since filter is changing so much, opacity would be the preferred method to use, however, as you can see, to be completely cross-browser compatible means being very thorough.




          Browser specific alternates:



          • -webkit-filter: filter(value);

          • -moz-filter: filter(value);

          • -o-filter: filter(value);

          • -ms-filter: "progid:DXCLASS.Object.Attr(value)";


          See Also:



          • What's compatible with opacity?


          • What's compatible with the newer filter?
            • keep in mind, not the same as Older IE's filter






          share|improve this answer















          filter in CSS had some different runs, namely for FireFox and MSIE.




          In MSIE 5.5 on through 7, filter, also known as Alpha Filter, actually makes use of MSIE's DX Filter (no longer supported). However, in order to be more CSS2.1 compliant, in IE8 MS introduced -ms-filter to replace filter. The syntax is different in that the value of -ms-filter must be encased in quotes. Eventually, IE9 brought deprecation to this method and as of IE10, it is no longer used.




          Another interesting note here, if you're wanting full compatibility for older IE, then you must make sure use of filter and -ms-filter must be very specific. For example, the following does not work in IE8 running IE7 compat mode:





          element 
          filter: alpha(opacity=50);
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";





          -ms-filter must come before filter in order to get more out of older IE compatibility.Like so:



          element 
          -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
          filter: alpha(opacity=50);




          FireFox made use of filter as an experiment gone awry. I believe the original idea was to mock what IE was doing in using the Direct X engine. There was even a browser specific version, as there was for most browsers at one time. Eventually, HTML5/CSS3 announced use of the filter namespace and it now has a new purpose.




          As of CSS3, filter now has a whole new meaning! Firefox docs stay open as if they plan to expand on this, though I've yet to see it (however they do crash JS if your CSS is not to its liking now!). Webkit (which will probably become standard in next update to CSS3) has started to implement filter to the point you can almost "photoshop" images for your site!



          Since filter is changing so much, opacity would be the preferred method to use, however, as you can see, to be completely cross-browser compatible means being very thorough.




          Browser specific alternates:



          • -webkit-filter: filter(value);

          • -moz-filter: filter(value);

          • -o-filter: filter(value);

          • -ms-filter: "progid:DXCLASS.Object.Attr(value)";


          See Also:



          • What's compatible with opacity?


          • What's compatible with the newer filter?
            • keep in mind, not the same as Older IE's filter







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 3 '13 at 17:51

























          answered Dec 2 '13 at 20:27









          SpYk3HHSpYk3HH

          19.2k85876




          19.2k85876







          • 3





            I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

            – Matthias Burger
            Jan 5 '17 at 8:35











          • @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

            – SpYk3HH
            Jan 6 '17 at 17:27












          • So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

            – AdrienK
            Jan 18 '17 at 9:26












          • @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

            – SpYk3HH
            Jan 18 '17 at 14:20












          • 3





            I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

            – Matthias Burger
            Jan 5 '17 at 8:35











          • @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

            – SpYk3HH
            Jan 6 '17 at 17:27












          • So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

            – AdrienK
            Jan 18 '17 at 9:26












          • @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

            – SpYk3HH
            Jan 18 '17 at 14:20







          3




          3





          I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

          – Matthias Burger
          Jan 5 '17 at 8:35





          I know, this post is dead, but, why is this answere is marked as correct? you only discribe about filter and -ms-filter (and the other browser specific filters). you didn't answere the question: what's the difference between using e.g. opacity:0.2 and filter:opactity(20%)?

          – Matthias Burger
          Jan 5 '17 at 8:35













          @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

          – SpYk3HH
          Jan 6 '17 at 17:27






          @MatthiasBurger " ... filter is changing so much, opacity would be the preferred method to use ... " Because OP got exactly what s/he wanted out of it.

          – SpYk3HH
          Jan 6 '17 at 17:27














          So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

          – AdrienK
          Jan 18 '17 at 9:26






          So to conclude... there is no reason to use filter over opacity except for IE < 6 compatibility (or IE < 9, as support is "partial" in between) ?

          – AdrienK
          Jan 18 '17 at 9:26














          @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

          – SpYk3HH
          Jan 18 '17 at 14:20





          @AdrienK Yeah pretty much. filter is really only for IE 5-7, and -ms-filter- is good till 9. For everything else, just use opacity. I'd encourage more "Your browser is not compat. Please upg" type pages for anything IE<=9

          – SpYk3HH
          Jan 18 '17 at 14:20













          0















          filter: opacity() applies transparency to the samples in the input image. The value of “amount” defines the proportion of the conversion.
          A value of 0% is completely transparent. A value of 100% leaves the
          input unchanged. Values between 0% and 100% are linear multipliers on
          the effect. This is equivalent to multiplying the input image samples
          by amount. If the “amount” parameter is missing, a value of 100% is
          used.



          filter: opacity() is similar to the more established opacity property; the difference is that with filters, some browsers provide
          hardware acceleration for better performance. Negative values are not
          allowed.




          Source: https://css-tricks.com/almanac/properties/f/filter/






          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>








          share|improve this answer























          • typo? u comparing filter: opacity() and filter: opacity()

            – Ivan
            2 days ago















          0















          filter: opacity() applies transparency to the samples in the input image. The value of “amount” defines the proportion of the conversion.
          A value of 0% is completely transparent. A value of 100% leaves the
          input unchanged. Values between 0% and 100% are linear multipliers on
          the effect. This is equivalent to multiplying the input image samples
          by amount. If the “amount” parameter is missing, a value of 100% is
          used.



          filter: opacity() is similar to the more established opacity property; the difference is that with filters, some browsers provide
          hardware acceleration for better performance. Negative values are not
          allowed.




          Source: https://css-tricks.com/almanac/properties/f/filter/






          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>








          share|improve this answer























          • typo? u comparing filter: opacity() and filter: opacity()

            – Ivan
            2 days ago













          0












          0








          0








          filter: opacity() applies transparency to the samples in the input image. The value of “amount” defines the proportion of the conversion.
          A value of 0% is completely transparent. A value of 100% leaves the
          input unchanged. Values between 0% and 100% are linear multipliers on
          the effect. This is equivalent to multiplying the input image samples
          by amount. If the “amount” parameter is missing, a value of 100% is
          used.



          filter: opacity() is similar to the more established opacity property; the difference is that with filters, some browsers provide
          hardware acceleration for better performance. Negative values are not
          allowed.




          Source: https://css-tricks.com/almanac/properties/f/filter/






          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>








          share|improve this answer














          filter: opacity() applies transparency to the samples in the input image. The value of “amount” defines the proportion of the conversion.
          A value of 0% is completely transparent. A value of 100% leaves the
          input unchanged. Values between 0% and 100% are linear multipliers on
          the effect. This is equivalent to multiplying the input image samples
          by amount. If the “amount” parameter is missing, a value of 100% is
          used.



          filter: opacity() is similar to the more established opacity property; the difference is that with filters, some browsers provide
          hardware acceleration for better performance. Negative values are not
          allowed.




          Source: https://css-tricks.com/almanac/properties/f/filter/






          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>








          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>





          /* USAGE EXAMPLE:
          * -----------
          * filter: opacity([ <number> or <percentage> ])
          * -----------
          */

          .filter-opacity
          filter: opacity(0.3);
          height: 5rem;
          width: 5rem;
          background-color: mediumvioletred;


          .just-opacity
          opacity: 0.3;
          height: 5rem;
          width: 5rem;
          background-color: lawngreen;

          <div class="filter-opacity">
          filter-opacity
          </div>

          <div class="just-opacity">
          just-opacity
          </div>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 11:34









          Arman NischArman Nisch

          19938




          19938












          • typo? u comparing filter: opacity() and filter: opacity()

            – Ivan
            2 days ago

















          • typo? u comparing filter: opacity() and filter: opacity()

            – Ivan
            2 days ago
















          typo? u comparing filter: opacity() and filter: opacity()

          – Ivan
          2 days ago





          typo? u comparing filter: opacity() and filter: opacity()

          – Ivan
          2 days ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20310219%2fwhat-is-the-difference-between-opacity-and-filter-opacity%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          政党

          天津地下鉄3号線