x
 
<!DOCTYPE html>
<html>
<head>
<style>
.mask1 {
  mask: linear-gradient(black, transparent); /* 线性渐变遮罩 */
}
.mask2 {
  mask: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0.5) 50%); /* 圆形径向渐变遮罩 */
}
.mask3 {
  mask: radial-gradient(ellipse, black 50%, rgba(0, 0, 0, 0.5) 50%); /* 椭圆形径向渐变遮罩 */
}
</style>
</head>
<body>
<h1>遮罩属性</h1>
<h3>带有遮罩层的图像(从上到下渐变):</h3>
<div class="mask1">
<img src="/i/photo/beijing.jpg" alt="北京" width="600" height="400">
</div>
<h3>带有遮罩层的图像(圆形):</h3>
<div class="mask2">
<img src="/i/photo/beijing.jpg" alt="北京" width="600" height="400">
</div>
<h3>带有遮罩层的图像(椭圆形):</h3>
<div class="mask3">
<img src="/i/photo/beijing.jpg" alt="北京" width="600" height="400">
</div>
<h3>原始图像:</h3>
<img src="/i/photo/beijing.jpg" alt="北京" width="600" height="400">
</body>
</html>