css艺术字效果,渐变字
实现的原理是利⽤CSS3的text-shadow属性,对⽂字的四个边均⽤阴影。
text-shadow属性:
语法:
text-shadow : none | <length> none | [<shadow>, ] * <shadow> 或none | <color> [, <color> ]*
上⼲货:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator"content="EditPlus®">
<meta name="Author"content="uniquejing">
<meta name="Keywords"content="">
<meta name="Description"content="">
<title>Document</title>
</head>
<style>
body {
background-color:#ECECEC;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color:#3c3c3c;
}
.test p:first-child {
text-align: center;
font-family: cursive;
font-size: 50px;
font-weight: bold;
letter-spacing: 5px;
color:#fff;
css特效文字
}
.test p:first-child span {
cursor: pointer;
text-shadow: 0px 0px 2px #686868,
0px 1px 1px #ddd,
0px 2px 1px #d6d6d6,
0px 3px 1px #ccc,
0px 4px 1px #c5c5c5,
0px 5px 1px #c1c1c1,
0px 6px 1px #bbb,
0px 7px 1px #777,
0px 8px 3px rgba(100, 100, 100, 0.4),
0px 9px 5px rgba(100, 100, 100, 0.1),
0px 10px 7px rgba(100, 100, 100, 0.15),
0px 11px 9px rgba(100, 100, 100, 0.2),
0px 12px 11px rgba(100, 100, 100, 0.25),
0px 13px 15px rgba(100, 100, 100, 0.3);
-webkit-transition: all .1s linear;
transition: all .1s linear;
}
.test p:first-child span:hover {
text-shadow: 0px 0px 2px #686868,
0px 1px 1px #fff,
0px 2px 1px #fff,
0px 3px 1px #fff,
0px 4px 1px #fff,
0px 5px 1px #fff,
0px 6px 1px #fff,
0px 6px 1px #fff,
0px 7px 1px #777,
0px 8px 3px #fff,
0px 9px 5px #fff,
0px 10px 7px #fff,
0px 11px 9px #fff,
0px 12px 11px #fff,
0px 13px 15px #fff;
-
webkit-transition: all .1s linear;
transition: all .1s linear;
}
</style>
<body>
<div class="test">
<p><span>Hope everyday is a productive day.</span></p> </div>
</body>
</html>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。