English 中文(简体)
CSS - Images
  • 时间:2024-12-22

CSS - Using Images


Previous Page Next Page  

Images play an important role in any webpage. Though it is not recommended to include a lot of images, but it is still important to use good images wherever required.

CSS plays a good role to control image display. You can set the following 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.

The Image Border Property

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

A width of zero pixels means no border.

Here is the example −

<html>
   <head>
   </head>

   <body>
      <img style = "border:0px;" src = "/css/images/logo.png" />
      <br />
      <img style = "border:3px dashed red;" src = "/css/images/logo.png" />
   </body>
</html> 

It will produce the following result −