Skip to content
Related Articles

Related Articles

Tailwind CSS Backdrop Contrast

Improve Article
Save Article
  • Last Updated : 23 Mar, 2022
Improve Article
Save Article

The Backdrop Contrast class is used to apply to set the Contrast of the image. This class can increase or decrease Contrast. Tailwind CSS newly added feature brightness in 2.1 version.

Backdrop Contrast:

  • backdrop-contrast-0: This class used to set the contrast on an element equivalent to CSS contrast(0).
  • backdrop-contrast-50: This class used to set the contrast on an element equivalent to CSS contrast(0.5).
  • backdrop-contrast-75: This class used to set the contrast on an element equivalent to CSS contrast(0.75).
  • backdrop-contrast-100: This class used to set the contrast on an element equivalent to CSS contrast(1.0).
  • backdrop-contrast-125: This class used to set the contrast on an element equivalent to CSS contrast(1.25).
  • backdrop-contrast-150: This class used to set the contrast on an element equivalent to CSS contrast(1.50).
  • backdrop-contrast-200: This class used to set the contrast on an element equivalent to CSS contrast(2.0).

Syntax:

<element class="filter backdrop-contrast-{amount}">..</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 Backderop Contrast 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-contrast-75 w-1/3">
            </div>
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-contrast-110 w-1/3">
            </div>
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-contrast-200 w-1/3">
            </div>
  
        </div>
          
    </div>
</body>
  
</html>

Output:


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!