新增第99个小实例:炫彩的发光字特效

This commit is contained in:
DESKTOP-BM6RJU5\wyanh 2022-01-18 17:34:37 +08:00
parent 89b609efa9
commit e2cf0fcd61
3 changed files with 67 additions and 1 deletions

View File

@ -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小实例炫彩的发光字特效

47
css/99.css Normal file
View File

@ -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);
}
}

18
html/99.html Normal file
View File

@ -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>