CSS Opacity / Transparency CSS

CSS Opacity / Transparency  

CSS Opacity / Transparency

Transparent Image

The opacity property specifies the opacity/transparency of an element.

The opacity property can take a value from 0.0 - 1.0. The lower value, the more transparent:

Example

img {
  opacity: 0.5;
  filter: alpha(opacity=50); /* For IE8 and earlier */
}

Transparent Hover Effect

The opacity property is often used together with the :hover selector to change the opacity on mouse-over:

Example

img {
  opacity: 0.5;
  filter: alpha(opacity=50); /* For IE8 and earlier */
}

img:hover {
  opacity: 1.0;
  filter: alpha(opacity=100); /* For IE8 and earlier */
}

Download free E-book of CSS


#askProgrammers
Learn Programming for Free


Join Programmers Community on Telegram


Talk with Experienced Programmers


Just drop a message, we will solve your queries