Horje
Tailwind CSS Backdrop Opacity

The Backdrop Opacity class is an inbuilt function that is used to apply a filter to the image to set the transparency of the image. In CSS, we do that by using the CSS opacity() Function. Tailwind CSS newly added feature brightness in 2.1 version.

Backdrop Opacity:

  • backdrop-opacity-number:

Note: Here the number is a variable that can be replaced by 0 to 100 with the gap of 5 like 5,10, 15 ……. up to 100.

Syntax:

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

Example:

HTML

<!DOCTYPE html>
<html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^2.1/dist/tailwind.min.css"
        rel="stylesheet">
</head>
  
<body class="text-center mx-4 ">
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1>
    <b>Tailwind CSS Backdrop Opacity Class</b>
    <div class=" mx-16 mt-18 h-36 relative">
        <div class="absolute w-full py-18">
            <img class="rounded-lg object-cover" 
            src=
            alt="image">
        </div>
         <div class="relative h-32 flex overflow-x-auto space-x-4">
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-hue-rotate-90 w-1/2">
            </div>
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-hue-rotate-90 
                        backdrop-opacity-25 w-1/2">
            </div>
        </div>        
    </div>
</body>
  
</html>

Output:




Reffered: https://www.geeksforgeeks.org


CSS

Related
Tailwind CSS Skew Tailwind CSS Skew
How to make grid items auto height using tailwind CSS ? How to make grid items auto height using tailwind CSS ?
How to align item set to its default value in CSS ? How to align item set to its default value in CSS ?
How to set the overflow property to scroll in CSS ? How to set the overflow property to scroll in CSS ?
How to draw an ellipse using CSS ? How to draw an ellipse using CSS ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12