文字渐变色 <p class="tt">你好呀</p> <style> .tt{ background-image: linear-gradient(red,white);//背景色渐变,默认从上到下 -webkit-background-clip: text;//设定背景的绘制范围为文字 color: transparent;//将字的颜色设置透明,只露出背景色 } </style>