Skip to content
Related Articles

Related Articles

Improve Article

Tailwind CSS Backdrop Blur

  • Last Updated : 09 Jun, 2021
Geek Week

The backdrop blur classes is used to apply a blurred effect filter to an element. Tailwind CSS newly added feature blur in 2.1 version.

Backdrop Blur Classes:

  • backdrop-blur-0: This class is equivalent to no blur effect on element as blur(0) in CSS.
  • backdrop-blur-sm: This class is equivalent to small blur effect on element as blur(4px) in CSS.
  • backdrop-blur: This class is equivalent to normal blur effect on element as blur(8px) in CSS.
  • backdrop-blur-md: This class is equivalent to medium blur effect on element as blur(12px) in CSS.
  • backdrop-blur-lg: This class is equivalent to large blur effect on element as blur(16px) in CSS.
  • backdrop-blur-xl: This class is equivalent to extra large blur effect on element as blur(24px) in CSS.
  • backdrop-blur-2xl: This class is equivalent to double extra large blur effect on element as blur(40px) in CSS.
  • backdrop-blur-3xl: This class is equivalent to triple extra large blur effect on element as blur(64px) in CSS.

Syntax:

<element class="filter backdrop-blur-{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 Backdrop Blur 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-blur-sm w-1/3">
            </div>
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-blur-md w-1/3">
            </div>
            <div class="flex-shrink-0 border-4 border-green-500 
                        backdrop-filter backdrop-blur-lg w-1/3">
            </div>
        </div
    </div>
</body>
  
</html>

Output:




My Personal Notes arrow_drop_up
Recommended Articles
Page :