概念:
1.先用linear-gradient 在background 做出渐层效果 background: -webkit-linear-gradient(bottom,#81411a 0,#8f5622 26%,#9b692a 50%,#c09034 100%);(起始位置,颜色代码 阶段)2. 使用background-clip,用text把background clip-webkit-background-clip: text;(chrome 浏览器要加-webkit-)3.最后把文字设成 trasparent 这样会吃到背景的颜色-webkit-text-fill-color: transparent;HTML<div class="content"> <h1>渐层文字</h1></div> CSS.content{background: -webkit-linear-gradient(bottom,#81411a 0,#8f5622 26%,#9b692a 50%,#c09034 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;}文章都是帮助自己记忆複习的,有错请多多指教谢谢。