<!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>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />
<title></title>
<style type="text/css">
.linear {
font-size:18px
font-weight:400
width:250px
height:40px
line-height:40px
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0, startColorStr=##218ee1, endColorStr=#ffffff)/*IE*/
background:-moz-linear-gradient(left, #218ee1, #fafafa)/*火狐*/
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#15A216), to(#ffffff))/*谷歌*/
background-image: -webkit-gradient(linear, left bottom, left top, color-start(0, #218ee1), color-stop(1, #ffffff))/* Safari &Chrome*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#15A216', endColorstr='#fafafa')/*IE6 &IE7*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#15A216', endColorstr='#fafafa')"/* IE8 */
}
</style>
</head>
<body>
<div class="linear">申请鉴定流程便捷</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条)