Tailwind CSS Blur
Tailwind CSS provides utilities to add a blur effect to elements on your web page. Adding a blurred background or element can give your website a sleek and sophisticated look.
Syntax
Add the blur-{amount}
utility class to apply a blur effect to an element, where {amount}
is a number between 0 and 5, representing the strength of the blur effect.
<div class="blur-3">
<!-- Content here -->
</div>
Example
Here's an example of how to add a blur effect to a background image using the bg-blur-{amount}
utility class:
<div class="bg-blur-3 h-screen w-full" style="background-image: url('your-image.jpg');">
<!-- Content here -->
</div>
Output
The above code will output a div element with a blurred background image that covers the entire height and width of the screen.
Explanation
The blur-{amount}
utility class applies a Gaussian blur filter to the element. The amount value ranges from 0 to 5, with 0 representing no blur and 5 representing the strongest blur.
The bg-blur-{amount}
utility class applies a blurred background to the element. This is useful when you want to add a blurred background to a section or a container on your page.
Use
Blurred elements can be used to add a touch of elegance to your website. You can use blurred backgrounds to display text and other content more prominently, or to create a sense of depth and contrast in your design.
Important Points
- The
blur-{amount}
utility class applies a blur effect to the element. - The
{amount}
value can range from 0 to 5, with 0 representing no blur and 5 representing the strongest blur. - The
bg-blur-{amount}
utility class applies a blurred background to the element.
Summary
With Tailwind CSS Blur utilities, you can easily add a sleek and modern touch to your website by applying a blur effect to an element or background. The amount of blur can be adjusted from 0 to 5, allowing for various levels of opacity and depth.