CSS3 定义了两种类型掘顷散的渐变(gradients):线性渐变(Linear Gradients)- 向下/向上/向左/向右/对判氏角方向
语乎老法:background-image: linear-gradient(direction, color-stop1, color-stop2, ...);
径向渐变(Radial Gradients)- 由它们的中心定义
语法:background-image: linear-gradient(angle, color-stop1, color-stop2);
background-image: -webkit-gradient
察慧乱
span {
background:linear-gradient(to right, red, blue);
-webkit-background-clip: text;
color: transparent;}
这个字体的颜色就败档是渐变色的
可以使用 background-image 属性并指定 linear-gradient 函数。
比如想为文本添加从红色到蓝咐族色的渐变告陪色:.text {
background-image: linear-gradient(to right, red, blue);
-webkit-text-fill-color: transparent;
}另外,还可袜简蠢以使用其他函数,例如 radial-gradient,以创建径向渐变。
希望这可以帮到你。
以上就是土嘎嘎小编大虾米为大家整理的css,color,渐变_怎样用css写线条左右渐变?相关主题介绍,如果您觉得小编更新的文章对您有所帮助,不要忘记讲本站分享给您身边的朋友哦!!