How to style images with CSS?

JavascriptWeb DevelopmentFront End Scripts

To style images with CSS, you need to use properties such as height, width, - moz-opacity, etc. Let us see how to create a transparent image with - moz-opacity CSS property:

The -moz-opacity property of an image is used to set the opacity of an image. 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:44:40