测试代码及说明:

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Simple CSS3 Animation</title>
<style type="text/css">
#demo {
position: absolute;
left: 30%;
top: 30%;
background-color: red;
width: 200px;
height: 200px;
-webkit-animation: animation1 2s linear forwards; /*只有Webkit内核的浏览器才能解析*/
-moz-animation: animation1 2s linear forwards; /*Firefox浏览器私有属性*/
-o-animation: animation1 2s linear forwards; /*Opera浏览器私有属性*/
-ms-animation: animation1 2s linear forwards; /*IE浏览器私有属性*/
animation: animation1 2s linear forwards; /*Firefox浏览器私有属性*/
} @-webkit-keyframes animation1 {
0% {
background: red;
} 50% {
background: blue;
} 100% {
background: yellow;
}
} @-moz-keyframes animation1 {
0% {
background: red;
} 50% {
background: blue;
} 100% {
background: yellow;
} } @-o-keyframes animation1 {
0% {
background: red;
} 50% {
background: blue;
} 100% {
background: yellow;
} } @-ms-keyframes animation1 {
0% {
background: red;
} 50% {
background: blue;
} 100% {
background: yellow;
}
} @keyframes animation1 {
0% {
background: red;
} 50% {
background: blue;
} 100% {
background: yellow;
} }
</style>
</head>
<body>
<div id="demo">
</div>
</body>
</html>

演示效果:

Animation用法的更多相关文章

  1. 前端CSS3动画animation用法

    前端CSS3动画animation用法 学习如下动画属性 @keyframes animation-name animation-duration animation-delay animation- ...

  2. 总结CSS3新特性(Animation篇)

    动画(Animation),是CSS3的亮点.//之一 通过animation属性指定@keyframe来完成关键帧动画; @keyframe用法: @keyframes name { 0% { to ...

  3. CSS3 @keyframes 用法(简单动画实现)

    定义: 通过 @keyframes 规则,能够创建动画. 创建动画的原理是,将一套 CSS 样式逐渐变化为另一套样式. 在动画过程中,可以多次改变这套 CSS 样式. 以百分比来规定改变发生的时间,或 ...

  4. WPF 自定义窗口关闭按钮

    关闭图标设计主要涉及主要知识点: 1.Path,通过Path来画线.当然一般水平.竖直也是可以用Rectangle/Border之类的替代 一些简单的线条图标用Path来做,还是很方便的. 2.简单的 ...

  5. [转] ReactNative Animated动画详解

    http://web.jobbole.com/84962/     首页 所有文章 JavaScript HTML5 CSS 基础技术 前端职场 工具资源 更多频道▼ - 导航条 - 首页 所有文章 ...

  6. Vue过渡效果之CSS过渡

    前面的话 Vue 在插入.更新或者移除 DOM 时,提供多种不同方式的应用过渡效果.本文将从CSS过渡transition.CSS动画animation及配合使用第三方CSS动画库(如animate. ...

  7. css3动画(@keyframes和animation的用法)

    animation基本用法是: animation: name keeping-time animate-function delay times iteration final; 第一个参数:nam ...

  8. CSS3动画属性animation的用法

    转载: 赞生博客 高端订制web开发工作组 » CSS3动画属性animation的用法 CSS3提供了一个令人心动的动画属性:animation,尽管利用animation做出来的动画没有flash ...

  9. Animation 动画详解(一)——alpha、scale、translate、rotate、set的xml属性及用法

    一.概述 Android的animation由四种类型组成:alpha.scale.translate.rotate,对应android官方文档地址:<Animation Resources&g ...

随机推荐

  1. 【算法题目】包含min函数的栈

    题目来源:<剑指offer>面试题21 题目:定义栈的数据结构,请在该类型中实现一个能够得到栈的最小元素的min函数.在该栈中,调用min,push以及pop的时间复杂度都是O(1). 分 ...

  2. reactjs入门到实战(五)---- props详解

    1>>>基础的props使用     不可修改父属性    getDefaultProps   对于外界/父组件的属性值,无法直接修改,它是只读的. <script type= ...

  3. FlashFXP命令行

    flashfxp.exe -upload ftp://user:pass@ip:port -localpath="本地路径"  -remotepath="远程FTP上的路 ...

  4. Android SDK版本和ADT版本

    Android SDK版本和ADT版本   Android早期的版本号有点“混乱”,比如Android 2.2对应的ADT版本为ADT-0.9.9而Android 2.3对应的的ADT版本则突然“跃迁 ...

  5. C语言第5天

    [1]数组 多个数据类型相同元素的集合: [2]访问元素 从下标0开始,到N-1结束 [3]定义数组 <存储类型> <数据类型 > <数组名>[<表达式> ...

  6. Using Text_IO To Read Files in Oracle D2k

    Suppose you want to read a file from D2k client and want to store its content in Oracle database. Bu ...

  7. C# 操作的时候接收用户输入密码进行确认

    首先新建一个原始窗体,如下:

  8. iOS案例:读取指定txt文件,并把文件中的内容输出出来

    用到的是NSString中的initWithContentsOfFile: encoding方法 // // main.m // 读取指定文件并输出内容 // // Created by Apple ...

  9. XAML基础

    1.标记扩展 将一个对象的属性值依赖在其他其他对象的某个属性上 用法:标记属性的一般用法是:Attribute = Value,使用标记拓展,Value字符串是由一对花括号及其括起来的内容组成,XAM ...

  10. Codeforces Round #279 (Div. 2) C. Hacking Cypher 前缀+后缀

    C. Hacking Cypher time limit per test 1 second memory limit per test 256 megabytes input standard in ...