<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>文字渐变效果</title>
<style type="text/css">
div{
width: 100px
height: 30px
color: #000
transition: color 1s
}
div:hover{
color: yellow
}
</style>
</head>
<body>
<div>移入试试看</div>
</body>
</html>
这个是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>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)