Set the opacity of an image with CSS

JavascriptWeb DevelopmentFront End Scripts

To set the opacity of an image, use the CSS -moz-opacity property. This property is used to create a transparent image in Mozilla. IE uses filter:alpha(opacity=x) to create transparent images.


You can try to run the following code to style an image and set opacity with CSS:

      <img style = "border:1px solid red;-moz-opacity:0.2;filter:alpha(opacity=50);"
         src = "" />
Updated on 31-Jan-2020 06:53:54