这是一款css剪裁GIF背景图片动画特效。该特效利用css的background-clip技术,将gif图片剪裁为文字效果,非常炫酷。
HTML结构
1 2 3 | <div class= "wrapper"> <div class= "text" data-text= "2020">2020</div><div> |
CSS样式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | .wrapper{ background: #252854; width: 100%; height:500px; border-radius: 5px; position: relative; }.text{ flex: 0 0 100%; font-size: 14rem; font-weight: 900; color: #00000000; text-align: center; font-family: 'Lato', sans-serif; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-bottom: 1px solid #d4d7ff; border-top: 1px solid #d4d7ff; background: url(./img/source.gif); background-clip: text; -webkit-background-clip: text;} .text:after{ content: attr(data-text); -webkit-text-stroke: 1.5px #d4d7ff; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -49%); background: url(./img/source.gif); background-clip: text; -webkit-background-clip: text; background-size: 43%; } |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com