是否可以通过CSS为文本设置水平渐变? (左字母一种颜色,右-另一种颜色) [英] Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour)

查看:97
本文介绍了是否可以通过CSS为文本设置水平渐变? (左字母一种颜色,右-另一种颜色)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过CSS为文本设置水平渐变? (左字母一种颜色,右-另一种颜色).

Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour).

推荐答案

是的.

h1 {
  font-size: 72px;
   background: -webkit-linear-gradient(left, red , yellow);
   background: -o-linear-gradient(right, red, yellow);
   background: -moz-linear-gradient(right, red, yellow);
   background: linear-gradient(to right, red , yellow); 
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

<h1>Hello World</h1>

这篇关于是否可以通过CSS为文本设置水平渐变? (左字母一种颜色,右-另一种颜色)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆