当前位置:网站首页>如何实现文字动画效果
如何实现文字动画效果
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%;
}
}
写在最后
以上就是每日一练的全部内容,希望今天的小练习对你有用,如果你觉得有帮助的话,请点赞我,关注我,并将它分享给你身边做开发的朋友,也许能够帮助到他。
边栏推荐
- Applet system update prompt, and force the applet to restart and use the new version
- Support multiple API versions in flask
- 剪映+json解析将视频中的声音转换成文本
- 自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
- go多样化定时任务通用实现与封装
- 2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行
- 在IPv6中 链路本地地址的优势
- 每日一题:力扣:225:用队列实现栈
- GPS from getting started to giving up (XI), differential GPS
- 二叉(搜索)树的最近公共祖先 ●●
猜你喜欢
Build op-tee development environment based on qemuv8
(十八)LCD1602实验
Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案
BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
基于 QEMUv8 搭建 OP-TEE 开发环境
Crawler obtains real estate data
Memorabilia of domestic database in June 2022 - ink Sky Wheel
Installation and use of labelimg
Common sense: what is "preservation" in insurance?
随机推荐
Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案
Gd32f4xx serial port receive interrupt and idle interrupt configuration
Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing
Classic sql50 questions
Barcodex (ActiveX print control) v5.3.0.80 free version
2022-07-05 stonedb的子查询处理解析耗时分析
新手程序员该不该背代码?
Support multiple API versions in flask
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
Classification, function and usage of MySQL constraints
Data storage (1)
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
[linear algebra] determinant of order 1.3 n
Management background --4, delete classification
0 basic learning C language - digital tube
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
Memorabilia of domestic database in June 2022 - ink Sky Wheel
Daily question 1: force deduction: 225: realize stack with queue
3DMax指定面贴图
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa