css中实现文字色彩渐变
tailwind写法:
必要的只有text-transparent bg-clip-text
对应color: transparent background-clip:text 用于将背景颜色作用于文字上
<span className="font-bold
text-transparent bg-clip-text
bg-gradient-to-r
from-indigo-500 via-purple-500 to-pink-500">
React
</span >
css写法:
.my-span {
font-weight: 700;
background-clip: text;
color: transparent;
-webkit-background-clip: text;
background-image: linear-gradient( to right, rgb(99,102,241), rgb(168,85,247),#ec4899);
}
webkit前缀用于适配chrome浏览器