What is a CSS gradient mask?
A CSS gradient mask is a visual effect that uses the mask-image property to create a fade effect on elements. It makes parts of an element gradually transparent using a linear gradient, creating beautiful transitions and fade effects.
How do I use gradient masks with Tailwind CSS?
You have two options: Inline Tailwind uses Tailwind's arbitrary value syntax (e.g., [mask-image:linear-gradient(...)]) directly in your HTML - no CSS file needed! Alternatively, use Custom Class mode to generate a reusable CSS class that you can add to your stylesheet.
Should I use inline Tailwind classes or custom CSS classes?
Inline Tailwind (recommended): Best for quick implementation and no extra CSS files. Uses Tailwind's arbitrary values directly in your HTML. Perfect for one-off uses or when you want to keep everything in your markup. Custom Class: Better when you need to reuse the same gradient mask across multiple elements or prefer separation of concerns with dedicated CSS classes.
What gradient mask directions are supported?
The generator supports multiple directions: Left to Right (90°), Right to Left (270°), Top to Bottom (180°), Bottom to Top (0°), and diagonal angles at 45°, 135°, 225°, and 315°. You can also set any custom angle from 0° to 360° using the slider for complete control.
Can I use gradient masks on text and images?
Yes! Gradient masks work on any HTML element including text, images, divs, sections, and other containers. The mask creates a fade effect by controlling the element's transparency, making it perfect for creating sophisticated visual effects in web design.
Can I control the gradient opacity and fade intensity?
Absolutely! The generator includes advanced opacity controls that let you set start and end opacity from 0-100%. You can also add middle stops for multi-step gradients, adjust gradient positions, and use quick presets like Full Fade (100% to 0%), Soft Fade (100% to 10%), or Edge Fade (starts at 70% position). This gives you complete control over the intensity and style of your gradient mask effects.
Is this gradient mask generator free?
Yes! This Tailwind gradient mask generator is completely free to use. Generate unlimited gradient masks, preview them live, and copy the code for your projects without any restrictions or registration required.
What browsers support CSS gradient masks?
CSS gradient masks using mask-image are supported in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. The generator includes the -webkit- prefix for broader compatibility with older browser versions.