首页
CSS
CSS 遮罩
试用:使用线性渐变作为遮罩层
运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <head> <style> p { font-size: 20px; padding: 20px; color: white; } .mask1 { max-width: 600px; height: 350px; overflow-y: scroll; background: url(img_5terre.jpg) no-repeat; -webkit-mask-image: linear-gradient(black, transparent); mask-image: linear-gradient (black, transparent); } </style> </head> <body> <h1>The mask-image Property</h1> <h3>A linear gradient as a mask layer:</h3> <div class="mask1"> <p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p> <p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p> <p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p> </div> </body> </html>