当前位置:网站首页>如何实现文字动画效果
如何实现文字动画效果
2022-07-06 14:48:00 【Phil Arist】
这个小项目是一个CSS实现的文字动画效果,主要就是用在页面加载时的效果,现在,我们一起来看一下这个项目的最终效果:
HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS实现文字动画效果</title>
</head>
<body>
<h1 data-text="正在加载中...">正在加载中...</h1>
</body>
</html>
CSS代码:
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body
{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #252839;
}
h1
{
position: relative;
font-size: 14vw;
color: #252839;
line-height: 1.2em;
text-transform: uppercase;
-webkit-text-stroke: 0.3vw #383d52;
}
h1:before
{
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
color: #01fe87;
overflow: hidden;
-webkit-text-stroke: 0vw #383d52;
border-right: 4px solid #01fe87;
animation: animate 4s linear infinite;
}
@keyframes animate
{
0%,10%,100%
{
width: 0;
}
70%,90%
{
width: 100%;
}
}
写在最后
以上就是每日一练的全部内容,希望今天的小练习对你有用,如果你觉得有帮助的话,请点赞我,关注我,并将它分享给你身边做开发的朋友,也许能够帮助到他。
边栏推荐
- Barcodex (ActiveX print control) v5.3.0.80 free version
- Web APIs DOM 时间对象
- Lora sync word settings
- Clip +json parsing converts the sound in the video into text
- 二叉(搜索)树的最近公共祖先 ●●
- [线性代数] 1.3 n阶行列式
- How do I write Flask's excellent debug log message to a file in production?
- 自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
- Web APIs DOM time object
- Chapter 4: talk about class loader again
猜你喜欢
GPS from getting started to giving up (12), Doppler constant speed
(18) LCD1602 experiment
Aardio - 通过变量名将变量值整合到一串文本中
2500个常用中文字符 + 130常用中英文字符
[线性代数] 1.3 n阶行列式
pytorch_ Yolox pruning [with code]
剑指offer刷题记录1
HDR image reconstruction from a single exposure using deep CNN reading notes
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
随机推荐
Mysql database basic operations DML
Management background --5, sub classification
【雅思口语】安娜口语学习记录part1
[sciter bug] multi line hiding
二分图判定
Four data streams of grpc
柔性数组到底如何使用呢?
Spatial domain and frequency domain image compression of images
0 basic learning C language - interrupt
中国固态氧化物燃料电池技术进展与发展前景报告(2022版)
基於 QEMUv8 搭建 OP-TEE 開發環境
Aardio - 通过变量名将变量值整合到一串文本中
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
ZABBIX proxy server and ZABBIX SNMP monitoring
Unity3d Learning Notes 6 - GPU instantiation (1)
Pit encountered by handwritten ABA
2500 common Chinese characters + 130 common Chinese and English characters
【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真
第3章:类的加载过程(类的生命周期)详解
Assembly and interface technology experiment 5-8259 interrupt experiment