CSS Opacity

Home / CSS / CSS Opacity

CSS Opacity


Opacity/Transparency:

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

Opacity in CSS refers to the transparency or the degree to which an element is see-through. It allows you to control the visibility of an element and its contents by adjusting its transparency level. The opacity property is used to achieve this effect.

Example :

<style>
    .box1 {
      background-color: green;
      opacity: 100%;
    }

    .box2 {
      background-color: green;
      opacity: 60%;
    }

    .box3 {
      background-color: green;
      opacity: 40%;
    }

    .box4 {
      background-color: green;
      opacity: 10%;
    }
  </style>


Output: