The Wayback Machine - https://web.archive.org/web/20231211213744/https://www.geeksforgeeks.org/tailwind-css-blur/
Open In App
Related Articles

Tailwind CSS Blur

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
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=
             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:


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 23 Mar, 2022
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials