新增第99个小实例:炫彩的发光字特效
This commit is contained in:
parent
89b609efa9
commit
e2cf0fcd61
|
@ -102,4 +102,5 @@
|
|||
95. HTML5+CSS3小实例:纯CSS实现冒泡loading动画
|
||||
96. HTML5+CSS3小实例:3D卡片hover翻转效果
|
||||
97. HTML5+CSS3小实例:纯CSS实现开箱子动画
|
||||
98. HTML5+CSS3小实例:创意条纹背景的图像悬停效果
|
||||
98. HTML5+CSS3小实例:创意条纹背景的图像悬停效果
|
||||
99. HTML5+CSS3小实例:炫彩的发光字特效
|
|
@ -0,0 +1,47 @@
|
|||
*{
|
||||
/* 初始化 */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body{
|
||||
/* 100%窗口高度 */
|
||||
min-height: 100vh;
|
||||
/* 弹性布局 水平+垂直居中 */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #06252e;
|
||||
}
|
||||
.container{
|
||||
/* 投影效果 */
|
||||
-webkit-box-reflect: below 1px linear-gradient(transparent,rgba(0,0,0,0.2));
|
||||
}
|
||||
h2{
|
||||
color: #fff;
|
||||
font-size: 96px;
|
||||
/* 字间距 */
|
||||
letter-spacing: 15px;
|
||||
/* 转大写 */
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
line-height: 76px;
|
||||
outline: none;
|
||||
/* 自定义属性--c,可通过var函数对其调用 */
|
||||
--c:lightseagreen;
|
||||
/* 调用自定义属性--c,设置文字阴影(发光效果) */
|
||||
text-shadow: 0 0 10px var(--c),
|
||||
0 0 20px var(--c),
|
||||
0 0 40px var(--c),
|
||||
0 0 80px var(--c),
|
||||
0 0 160px var(--c);
|
||||
/* 执行动画:动画名 时长 线性的 无限次播放 */
|
||||
animation: animate 5s linear infinite;
|
||||
}
|
||||
|
||||
/* 定义动画 */
|
||||
@keyframes animate {
|
||||
to{
|
||||
/* 色相旋转滤镜(设置度数可改变颜色) */
|
||||
filter: hue-rotate(360deg);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
|
||||
|
||||
<title>炫彩的发光字特效</title>
|
||||
<link rel="stylesheet" href="../css/99.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2 contenteditable="true">hello</h2>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue