当前位置:网站首页>【案例】animation动画曲线之steps的使用
【案例】animation动画曲线之steps的使用
2022-08-05 16:11:00 【发呆少女】
使用steps时,如果需要循环播放,则需要在steps中加入start,不然steps在页面的显示会少一次;或加入end,再重新调整相关参数。
方式1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> div {
overflow: hidden; /* 强制一行显示 */ white-space: nowrap; width: 0; height: 25px; background-color: pink; font-size: 20px; line-height: 25px; /* 使用steps时,如果需要循环播放,则需要在steps中加入start,不然steps在页面的显示会少一次 或加入end,再重新调整相关参数*/ animation: move 3s steps(5, start) infinite; } @keyframes move {
0% {
width: 0; } 100% {
width: 100px; } } </style>
</head>
<body>
<div>啦啦啦啦啦</div>
</body>
</html>
方式2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> div {
overflow: hidden; /* 强制一行显示 */ white-space: nowrap; width: 0; height: 25px; background-color: pink; font-size: 20px; line-height: 25px; /* 使用steps时,如果需要循环播放,则需要在steps中加入start,不然steps在页面的显示会少一次 或加入end,再重新调整相关参数*/ animation: move 3s steps(6, end) infinite; } @keyframes move {
0% {
width: 0; } 100% {
width: 120px; } } </style>
</head>
<body>
<div>啦啦啦啦啦</div>
</body>
</html>


边栏推荐
- [Supplementary Question Diary] [2022 Hangzhou Electric Summer School Multi-School 3] B-Boss Rush
- WPF 截图控件之移除控件(九)「仿微信」
- High Numbers_Prove_Uniqueness of Limits
- 无代码平台函数入门教程
- Redis Series 5: In-depth Analysis of Cluster Cluster Mode
- 如何使用 JDBC PreparedStatement将值列表动态添加到 IN 子句
- 软件供应链的漏洞及攻击类型
- 记一次对某站点详细的渗透测试
- 流行的 Web 框架安全性比较
- BEVDet:High-Performance Multi-Camera 3D Object Detection in Bird-Eye-View 论文笔记
猜你喜欢

他,高中毕业,46岁收获一个360亿IPO

这个「令人上头」的赛道,俞敏洪、高瓴都入了,红杉和腾讯会来吗?

Monotonic Bounded Criterion for High Numbers_Prove_Limit Existence

Notes from Google Play | Google Play 持续助力您的应用和游戏

High Numbers_Proof_Intermediate Value Theorem

高数_证明_极限的局部保号性

【OneNote】书写有层次结构的内容+快速折叠/展开各层次内容

数据库篇——hash索引

基于consul的服务注册与消费案例

【七夕限定盲盒抽奖】一文带你搞懂盲盒抽奖的页面配置
随机推荐
二叉树结点查找
Locally boundedness of high number_proof_limit
无代码平台单行文字入门教程
高数_证明_极限的局部保号性
这个「令人上头」的赛道,俞敏洪、高瓴都入了,红杉和腾讯会来吗?
Registered less than a week for data security in the British parliament TikTok dispute the substance is discontinued
华为云鲲鹏ARM服务器使用MCSM9搭建 我的世界(MC) 1.18.2 版服务器教程
泊松编辑 (Poisson Image Editing)
WeChat applet realizes weather forecast access
解决FileZilla 报错“无法和 SFTP 服务器建立 FTP 连接,请选择合适的协议”
无代码平台逻辑表单入门教程
一个程序员的水平能差到什么程度?
High Numbers_Prove_The Clamping Criterion of the Existence of Limits
Redis系列5:深入分析Cluster 集群模式
[Supplementary Questions Diary] [2022 Niu Ke Summer Multi-School 4] A-Task Computing
HDBaseT是什么协议?与SDI和HDMI比较有哪些区别?
RestTemplate上传文件
C语言之链表简单操作(亲测可用)
cmd/powershell/anaconda prompt提示“系统找不到指定的路径”
EasyCVR调用停止实时录像接口,未返回录像地址该如何解决?