Last active
December 26, 2015 23:39
-
-
Save LiuJi-Jim/7232275 to your computer and use it in GitHub Desktop.
CSS3 渐变文字
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>CSS3文字渐变</title> | |
<meta charset="UTF-8"> | |
<style type="text/css"> | |
body { | |
margin:0; | |
padding:0; | |
background:#fff; | |
font-family:"微软雅黑", Sans-Serif; | |
font-weight:900; | |
-webkit-font-smoothing:antialiased; | |
-webkit-text-stroke:1px transparent; /*山寨消锯齿方法,手机上看效果不好,PC webkit上看效果好*/ | |
} | |
#wrap span.fg { | |
color:#f00; /*fallback*/ | |
font-size:160px; | |
background:-webkit-gradient(linear, left top, right bottom, from(#f00), to(#00f)); | |
-webkit-background-clip:text; | |
-webkit-text-fill-color:transparent; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="wrap"> | |
<span class="fg">呵呵</span> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment