Blur and brightness filters help you change how things look on your webpage. Blur makes things fuzzy, and brightness makes things lighter or darker.
Blur and brightness filters in Tailwind
blur-{size}
brightness-{percentage}Sizes for blur can be like blur-sm, blur, blur-md, blur-lg, blur-xl, blur-2xl.
Brightness uses percentages like brightness-50 (darker) to brightness-150 (brighter).
<div class="blur-sm">This text is slightly blurry.</div><img class="brightness-125" src="photo.jpg" alt="Bright photo">
<div class="blur-lg brightness-75">Blurred and darker box</div>This page shows three examples: a blurred background image with text on top, a button that gets brighter when hovered, and a box that is slightly blurred and brighter.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Blur and Brightness Filters</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="flex flex-col items-center justify-center min-h-screen gap-8 bg-gray-100 p-6"> <h1 class="text-2xl font-bold">Blur and Brightness Filters Example</h1> <div class="relative w-64 h-40"> <img src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=400&q=80" alt="Nature" class="w-full h-full object-cover rounded-lg blur-md"> <p class="absolute inset-0 flex items-center justify-center text-white text-lg font-semibold">Blurred Background</p> </div> <button class="px-6 py-3 bg-blue-600 text-white rounded-lg brightness-90 hover:brightness-125 transition"> Hover me to brighten </button> <div class="w-64 h-24 bg-green-400 rounded-lg blur-sm brightness-110 flex items-center justify-center text-white font-medium"> Slightly blurred and brighter box </div> </body> </html>
Use transition classes to make brightness changes smooth on hover.
Blur can affect readability, so use it carefully especially on text.
Brightness values below 100% make things darker, above 100% make them brighter.
Blur and brightness filters change how elements look by making them fuzzy or lighter/darker.
Tailwind uses simple class names like blur-md and brightness-125 to apply these effects.
Combine these filters with hover and transition for nice interactive effects.