<style>
.text-gradient {
display: inline-block
color: green
font-size: 10em
font-family: '微软雅黑'
background-image: -webkit-gradient(linear, 0 0, 0 bottom, from(rgba(0, 0, 0, 1)), to(rgba(51, 51, 51, 1)))
-webkit-background-clip: text
-webkit-text-fill-color: transparent
}
</style>
这个是CSS3实现,必须浏览器支持<html>
<body>
<style type="text/css">
.text-gradient {
display: inline-block
color: green
font-size: 8em
font-family: 微软雅黑
background-image: -webkit-gradient(linear, 0 0, 0 bottom, from(rgba(0, 128, 0, 1)), to(rgba(51, 51, 51, 1)))
-webkit-background-clip: text
-webkit-text-fill-color: transparent
}
</style>
<h2 class="text-gradient">我</h2>
</body>
</html>