Home
CSS
CSS Masking
Tryit: Use a radial gradient as the mask layer
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> .mask3 { -webkit-mask-image: radial-gradient(ellipse, black 50%, rgba(0, 0, 0, 0.5) 50%); mask-image: radial-gradient(ellipse, black 50%, rgba(0, 0, 0, 0.5) 50%); } </style> </head> <body> <h1>The mask-image Property</h1> <h3>A radial gradient as a mask layer (an ellipse):</h3> <div class="mask3"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>Original image:</h3> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </body> </html>