Skip to content
Related Articles

Related Articles

Tailwind CSS Blur

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

The blur class is used to apply a blurred effect filter on the image. In CSS, we do that by using the CSS blur() Function. Tailwind CSS newly added feature blur in 2.1 version.

Blur:

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

Syntax:

<element class="filter 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 space-y-2">
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1>
    <b>Tailwind CSS Blur Class</b>
    <div class="grid grid-flow-col text-center p-4">
        <img class="rounded-lg filter blur-0" 
          src=
             alt="image">
        <img class="rounded-lg filter blur-sm" 
             src=
             alt="image">
        <img class="rounded-lg filter blur-md" 
             src=
             alt="image">
        <img class="rounded-lg filter blur-lg" 
             src=
             alt="image">
        <img class="rounded-lg filter blur-xl" 
             src=
             alt="image">
          
    </div>
</body>
  
</html>


Output:


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!