Red
p:after {
position: absolute;
z-index: -2;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
background-image: inherit;
}
p:before {
position: absolute;
z-index: -1;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
background-color: rgba(256, 256, 256, .5);
}
p {
font-size: 120px;
line-height: 600px;
position: relative;
display: block;
width: 551px;
overflow: hidden;
text-align: center;
color: #fff;
-webkit-text-fill-color: transparent;
background-image: url(a.png);
-webkit-background-clip: text;
}
一开始想的是透明字加超大阴影,弄不出来,搞了这个,不过兼容性堪忧,还是用canvas好~
编辑了下,后退更平稳~