CSS线性渐层文字如何写?

概念:

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;}文章都是帮助自己记忆複习的,有错请多多指教谢谢。

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章