简体   繁体   English

如何实现这种CSS效果

[英]How to achieve this CSS effect

I was wondering how the guys who made carv.ai achieved the text masking effect on the paragraph "Carv connects wirelessly ...". 我想知道制作carv.ai的人如何在“ Carv无线连接...”这一段上实现了文本屏蔽效果。

I know that we can mask a background image on a text. 我知道我们可以在文本上遮盖背景图像。

The first thing that you can do to have text masking, is either give the masking div a greater z-index than the text, or make the text the same color as the masking color. 进行文本遮罩的第一件事是为遮罩div提供比文本更大的z-index ,或者使文本与遮罩颜色相同。 Then you can use jQuery to make the div slide away. 然后,您可以使用jQuery使div滑开。

Here is the jQuery: 这是jQuery:

$("#id").animate({width:'toggle'},350);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM