Open In App
Related Articles

Tailwind CSS Opacity

Improve Article
Save Article
Like Article

This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. By using this class we can set the opacity of any element. In CSS, we do that by using the CSS Opacity property.

Opacity class:

  • opacity-0: Control the opacity of an element.

Note: The number of the opacity can be changeable from 0 to 100 with the span of 5.


<element class="opacity-{number}">...</element>



<!DOCTYPE html> 
    <link href
<body class="text-center mx-4 space-y-2"
    <h1 class="text-green-600 text-5xl font-bold"
    <b>Tailwind CSS Opacity Class</b
    <div class="grid grid-flow-col text-center p-2"
        <div class="opacity-100  w-24 h-24 bg-green-500 
        <div class="opacity-75 w-24 h-24 bg-green-500 
        <div class="opacity-50 w-24 h-24 bg-green-500 
        <div class="opacity-25 w-24 h-24 bg-green-500 
        <div class="opacity-0  w-24 h-24 bg-green-500 


Tailwind CSS opacity class

Last Updated : 23 Mar, 2022
Like Article
Save Article
Similar Reads
Related Tutorials