说明:CSS3实现文字颜色渐变
文字颜色渐变:
1.代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
span {
font-size: 40px;
background:linear-gradient(to right,#FF2814,#0290E5);
-webkit-background-clip: text;
color: transparent;
}
</style>
</head>
<body>
<span>乾坤未定你我皆是黑马</span>
</body>
</html>
2.页面效果
3.说明属性
** background:linear-gradient(to right,#FF2814,#0290E5);这是设置渐变色**
设置right让文字渐变色至左往右
也可以设置为bottom文字渐变色至上往下
background-clip:text; 属性 规定背景的绘制区域
** color: transparent;这把字