css 动画使用

使用CSS动画 (Using CSS Animations)

CSS animations add beauty to the webpages and make transitions from one CSS style to the other beautiful.

CSS动画可以使网页更加美观,并可以从一种CSS样式过渡到另一种CSS样式。

To create a CSS animation sequence, we have different sub-properties in the animation property in CSS :

要创建CSS动画序列,我们在CSS的animation属性中具有不同的子属性:

  • animation-delay

    animation-delay

  • animation-direction

    animation-direction

  • animation-duration

    animation-duration

  • animation-iteration-count

    animation-iteration-count

  • animation-name

    animation-name

  • animation-play-state

    animation-play-state

  • animation-timing-function

    animation-timing-function

  • animation-fill-mode

    animation-fill-mode

示例CSS动画序列可在屏幕上移动文本 (Sample CSS animation sequence to move text across the screen)

In the HTML part we will have a div with class container and a h3 with the text Hello World:

在HTML部分,我们将有一个带类containerdiv和一个带文本Hello Worldh3

<div class="container"><h3> Hello World ! </h3>
</div>

For the CSS part:

对于CSS部分:

.container {/* We will define the width, height and padding of the container *//* The text-align to center */width: 400px;height: 60px;padding: 32px;text-align: center;/* Use the animation `blink` to repeat infinitely for a time period of 2.5s*/animation-duration: 2.5s;           animation-iteration-count: infinite;animation-direction: normal;        animation-name: blink;              /* The same can be written shorthand as     *//* --------------------------------------   *//* animation: 2.5s infinite normal blink;   */
}
@keyframes blink {0%, 100% {              /* Defines the properties at these frames */background: #333;color: white;}50% {                   /* Defines the properties at these frames */background: #ccc;color: black;border-radius: 48px;}
}

有关CSS动画的更多信息: (More information on CSS Animations:)

  • A Quick intro to CSS Animations

    CSS动画快速入门

翻译自: https://www.freecodecamp.org/news/how-to-use-animations-in-css/

css 动画使用

css 动画使用_如何在CSS中使用动画相关推荐

  1. css链接样式_如何在CSS中设置链接样式

    css链接样式 样式链接 (Styling Links) Links can be styled with any CSS property, such as color, font-family, ...

  2. react 交互_如何在React中建立动画微交互

    react 交互 Microinteractions guide a user through your application. They reinforce your user experienc ...

  3. 表格在整个html居中显示,html 表格字符居中显示_如何在HTML中居中显示表格?

    html 表格字符居中显示_如何在HTML中居中显示表格? html 表格字符居中显示_如何在HTML中居中显示表格? html 表格字符居中显示 HTML table provides the ab ...

  4. figma设计_如何在Figma中构建设计入门套件(第1部分)

    figma设计 Figma教程 (Figma Tutorial) Do you like staring at a blank canvas every time you start a new pr ...

  5. 在excel日期比对大小_如何在Excel中防止分组日期

    在excel日期比对大小 As a teenager, group dates can be fun. If you have strict parents, that might be the on ...

  6. css在兼容模式下无法引用_如何在CSS中使用深色模式

    css在兼容模式下无法引用 by Frank Lämmer 由FrankLämmer 如何在CSS中使用深色模式 (How to get dark mode working with CSS) I h ...

  7. css椭圆圆形边框_使用CSS在弧形,圆形和椭圆形中制作动画元素

    css椭圆圆形边框 Web animation is most often created between two points: from and to a state, or between po ...

  8. 如何在html中加入动画效果,纯css如何实现按钮的水滴动画效果?

    纯css如何实现按钮的水滴动画效果?下面本篇文章就来给大家介绍一下使用纯css实现Material Design中按钮的水滴动画效果.有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助. ...

  9. 前端背景图放置_如何在css中添加背景图?

    在前端开发过程中,为了页面的美观,往往都会给html页面添加背景图片.那么如何利用css设置html中用图片做背景?本章就给大家介绍css怎样设置背景图片. css background属性就是专门设 ...

最新文章

  1. 【Dual-Path-RNN-Pytorch源码分析】AudioReader
  2. python中字典格式_如何在Python中使用带有字典的格式函数和整数键
  3. vs2012html图片,简单几步 实现vs2010对html5的支持
  4. sybase数据库导出mysql_sybase导出数据库的表结构命令
  5. 3d相册 html 代码_HTML5 3D立体图片相册
  6. 学python语言用什么软件-Python是什么?学习Python用什么编译器?
  7. Spark学习之路 (十五)SparkCore的源码解读(一)启动脚本
  8. 前端学习(2534)vue源码解析
  9. python创建变量_【转载】 Python动态生成变量
  10. 关闭selinux服务
  11. java 获取mac地址_java入门知识点和环境准备
  12. [转]git使用指南系列
  13. FIR滤波器——Matlab实现
  14. 【Python数据分析】<数据分析工具>基于Excel的数据分析
  15. 流浪者(rover)
  16. JavaScript判断手机号运营商是移动、联通、电信还是其他(代码简单
  17. android发短信!渣本毕业两年经验,终局之战
  18. 点集排序(快速排序)
  19. RMAN Crosscheck/Delete
  20. 常见的浏览器指纹包含哪些

热门文章

  1. 【Leetcode】112. 路径总和
  2. java拦截器和过滤器,2021最新版!
  3. 实现技术3次作业 谢筱 1101220759
  4. 【模板】可持久化线段树
  5. 为什么toString方法可以用来区分数组和对象?
  6. 项目启动及需求分析(靳嘉豪、胡新宇、李晨曦、杨航、李瑶)团队作业
  7. PIL简单图片处理(上)
  8. 将Session写入Memcache
  9. ASP.NET会员注册登录模块(MD5加密,Parameters防止SQL注入,判断是否注册)
  10. DW 在onload运行recordset find.html时 发生了以下javascript错误