CSS Images - CSS

How to Use CSS Image?

Images acts as an prominent role in any webpage. It is important to use good images wherever required in any document required.
CSS plays a good role in controlling image display. You can set the below image properties using CSS.
  • The border property is used to set the width of an image border.
  • The height property is used to set the height of an image.
  • The width property is used to set the width of an image.
  • The -moz-opacity property is used to set the opacity of an image.

How to use Image Border Property?

The border property of an image is used to assign the width of an image border. This property can have any value in length or in %.

A width of zero pixels means no border.

Here is the example −

How to use the Image Height Property?

The height property of an image is used to set the height of an image. This property can have a value in length or in %. While giving value in %, it applies with respect to the box in which an image is present.

Here is an example −

How to use the Image Width Property?

The width property of an image is used to set the width of an image. This property can have a value in length or in %. While giving value in %, it applies it with respect to the box in which an image is available.

Here is an example −

How to use the -moz-opacity Property?

The -moz-opacity property of an image is used for defining the opacity of an image to be uploaded. This opacity property is used to create a transparent image in Mozilla, whereas Explorer uses filter:alpha(opacity=x) to create transparent images.


In Mozilla, (-moz-opacity:x) x can be a value from 0.0 - 1.0. A lower value makes the element more transparent (The same thing applies for the CSS3-valid syntax opacity:x).


In Internet Explorer, (filter:alpha(opacity=x)) x can be a value from 0 - 100. A lower value makes the element more transparent.

Below is an example −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

CSS Topics