运行 ❯
获取您
的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .masked { width: 150px; height: 150px; background: green; border: 30px solid blue; padding: 20px; -webkit-mask-image: url(img_circle.svg); mask-image: url(img_circle.svg); mask-size: 100% 100%; } .mask1 { mask-clip: border-box; } .mask2 { mask-clip: content-box; } .mask3 { mask-clip: padding-box; } .mask4 { mask-clip: fill-box; } .mask5 { mask-clip: stroke-box; } </style> </head> <body> <h1>The mask-clip Property</h1> <h3>Set mask-clip: border-box:</h3> <div class="masked mask1"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>Set mask-clip: content-box:</h3> <div class="masked mask2"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>Set mask-clip: padding-box:</h3> <div class="masked mask3"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>Set mask-clip: fill-box:</h3> <div class="masked mask4"> <img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400"> </div> <h3>Set mask-clip: stroke-box:</h3> <div class="masked mask5"> <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>