我有解决方案,但它只适用于我的 chrome。
给你。
p {
background: linear-gradient(to bottom, #F00 0%,#630000 100%);
background: -moz-linear-gradient(top, #F00 0%,#630000 100%);
background: -webkit-gradient(linear, left top,left bottom, color-stop(0%,#F00 ), color-stop( 100%,#630000));
background: -webkit-linear-gradient(top, #F00 0%,#630000 100%);
background: -o-linear-gradient(top, #F00 0%,#630000 100%);
background: -ms-gradient(to bottom, #F00 0%,#630000 100%);
/*i.e */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F00', endColorstr='#630000', GradientType=0 );
/* gradient targets only on letter and not on the background*/
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;*/
显然
0% 表示渐变从顶部开始
100% 表示渐变在字母末尾结束。
你也可以使用类似的东西
background: linear-gradient(to bottom, #F00 33%,#630000 100%);
如果您想将其应用于特定区域。