Open In App

Tailwind CSS Blur

Last Updated : 23 Mar, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

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=
"https://media.geeksforgeeks.org/wp-content/uploads/20210604014825/QNHrwL2q-100x100.jpg" 
             alt="image">
        <img class="rounded-lg filter blur-sm" 
             src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210604014825/QNHrwL2q-100x100.jpg" 
             alt="image">
        <img class="rounded-lg filter blur-md" 
             src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210604014825/QNHrwL2q-100x100.jpg" 
             alt="image">
        <img class="rounded-lg filter blur-lg" 
             src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210604014825/QNHrwL2q-100x100.jpg" 
             alt="image">
        <img class="rounded-lg filter blur-xl" 
             src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210604014825/QNHrwL2q-100x100.jpg" 
             alt="image">
        
    </div>
</body>

</html>

Output:


Next Article

Similar Reads