运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .mask1 { -webkit-mask-image: linear-gradient(black, transparent); mask-image: linear-gradient(black, transparent); } .mask2 { -webkit-mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0.5) 50%); mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0.5) 50%); } .mask3 { -webkit-mask-image: radial-gradient(black 50%, rgba(0, 0, 0, 0.5) 50%); mask-image: radial-gradient(black 50%, rgba(0, 0, 0, 0.5) 50%); } </style> </head> <body> <h1>The mask-image Property</h1> <h3>An image with a mask layer (from top to bottom):</h3> <div class="mask1"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>An image with a mask layer (a circle):</h3> <div class="mask2"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>An image with 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>