Skip to main content

Opacity

The opacity-level describes the transparency-level, where 1 is not transparent at all, 0.5 is 50% see-through, and 0 is completely transparent. Note: When using the opacity property to add transparency to the background of an element, all of its child elements become transparent as well.

Examples

Example Example Example Example Example Example
            
             <img src="../assets/img-min/img1.jpg" class="opacity-50" alt="Example" />
             <img src="../assets/img-min/img1.jpg" class="opacity-60" alt="Example" />
             <img src="../assets/img-min/img1.jpg" class="opacity-70" alt="Example" />
             <img src="../assets/img-min/img1.jpg" class="opacity-80" alt="Example" />
             <img src="../assets/img-min/img1.jpg" class="opacity-90" alt="Example" />
             <img src="../assets/img-min/img1.jpg" class="opacity-100" alt="Example" />
            
          

Notation

The classes are named using the format {property}-{size}.

Where property is one of:

  • opacity - for classes that set opacity

Where size is one of:

  • 0 - (by default) for classes that set the opacity to 0 (transparent)
  • 10 - (by default) for classes that set the opacity to .1
  • 20 - (by default) for classes that set the opacity to .2
  • 30 - (by default) for classes that set the opacity to .3
  • 40 - (by default) for classes that set the opacity to .4
  • 50 - (by default) for classes that set the opacity to .5
  • 60 - (by default) for classes that set the opacity to .6
  • 70 - (by default) for classes that set the opacity to .7
  • 80 - (by default) for classes that set the opacity to .8
  • 90 - (by default) for classes that set the opacity to .9
  • 100 - (by default) for classes that set the opacity to 1 (normal)