CSS ImagesTransparency/Opacity
Using CSS, it is easy to create transparent images.
Note:The CSS Opacity property is part of the W3C CSS3 recommendation.
More Examples
Create Transparent Image - Hover Effect
Create a Transparent Box with Text and a Background Image
Example 1 - Create a transparent image
The CSS3 opacity property isopacity。
First, we will show you how to create a transparent image using CSS.
Normal Image

The same image with transparency:

See the CSS below:
IE9, Firefox, Chrome, Opera, and Safari use the opacity property to make images transparent. The opacity property value ranges from 0.0 to 1.0. The smaller the value, the more transparent the element will be.
IE8 and earlier versions use filter: alpha (opacity= x). The value of x can be from 0 to 100. Lower values make the element more transparent.
Example 2 - Image Transparency - Hover Effect
Move the mouse over the image:


CSS Styles:
The first CSS block is similar to the code in Example 1. In addition, we have added what happens when the user hovers over one of the images. In this case, when the user hovers over the image, we want the image to be clear.
This CSS is:opacity=1.
IE8 and earlier versions use:filter:alpha(opacity=100).
When the mouse pointer moves away from the image, the image will regain its transparency.
Example 3 - Text in a transparent box
This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box. This text is in a transparent box.
The source code is as follows:
First, we create a div element with a fixed height and width, with a background image and a border. Then we create a smaller div element inside the first div. This div also has a fixed width, a background color, and a border - and it is transparent. Inside the transparent div, we add some text in a p element.
other extensions