当前位置:网站首页>How to achieve text animation effect
How to achieve text animation effect
2022-07-06 22:42:00 【Phil Arist】
This small project is a CSS Achieved text animation effect , Mainly used in the effect of page loading , Now? , Let's take a look at the final effect of this project :
HTML Code :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS Achieve text animation effect </title>
</head>
<body>
<h1 data-text=" Loading ..."> Loading ...</h1>
</body>
</html>
CSS Code :
{
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%;
}
}
At the end
The above is the whole content of daily practice , I hope today's little exercise is useful to you , If you think it helps , Please praise me , Pay attention to me , And share it with your development friends , Maybe it can help him .
边栏推荐
猜你喜欢
(18) LCD1602 experiment
ACL 2022 | 序列标注的小样本NER:融合标签语义的双塔BERT模型
Aardio - integrate variable values into a string of text through variable names
UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop
Rust knowledge mind map XMIND
[leetcode] 19. Delete the penultimate node of the linked list
自定义 swap 函数
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
新手程序员该不该背代码?
LeetCode 练习——剑指 Offer 26. 树的子结构
随机推荐
Should novice programmers memorize code?
void关键字
Export MySQL table data in pure mode
Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing
GD32F4XX串口接收中断和闲时中断配置
poj 1094 Sorting It All Out (拓扑排序)
Matlab tips (27) grey prediction
POJ 1094 sorting it all out
NPM cannot install sharp
MySQL ---- first acquaintance with MySQL
Installation and use of labelimg
The difference between enumeration and define macro
What are the specific steps and schedule of IELTS speaking?
Mysql 身份认证绕过漏洞(CVE-2012-2122)
Volatile keyword
Aardio - Method of batch processing attributes and callback functions when encapsulating Libraries
变量与“零值”的比较
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Gd32f4xx serial port receive interrupt and idle interrupt configuration
Machine test question 1