测试代码及说明:

<!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. Unity-Animator深入系列---控制IK

    回到 Animator深入系列总目录 要让代码控制IK,需要先在Animator中打开IK pass 然后,和IK相关的代码需要放到相应的函数中去: void OnAnimatorIK() { Deb ...

  2. 切分vocab时遇到的问题

    vocab的格式如下所示,每个词和对应100维的向量: </s> 0.004003 0.004419 -0.003830 -0.003278 0.001367 0.003021 0.000 ...

  3. centos6.5用户添加到sudoers中

    一.将用户添加到sudoers su vi /etc/sudoers :x! success 二.解释 su 目的是使用最高root权限去进行修改操作 vi /etc/sudoers 使用vi编辑器打 ...

  4. 织梦cms PHPcms 帝国cms比较

    现在建网站不需要请程序员从基础的程序开发做起了,有专业的建站工具,CMS是使用最广泛的建站工具.CMS是Content Management System 现在建网站不需要请程序员从基础的程序开发做起 ...

  5. Jquery实现图片上下一张

    注:调试的时候发现ff下有兼容性问题,把jquery换成4.4版本就没问题了,问题应该在e.offseX上ff不支持此属性,以图片中间宽度为界限,鼠标移动在左边点击跳转到一个链接,鼠标移动右边点击跳转 ...

  6. PHP 对字符串进行十六进制替换 invalid character in attribute value

    最近在xml传输过程中遇到字符串报错,表面看上去没有任何错误.将文件用winhex打开,看到对应字符串中多了'1F'.xml无法解析'1F'.随后在代码中将这个替换掉. $str = pack(&qu ...

  7. 在主类E的main方法中,创建类B 的对象并赋给父类A的对象a,使用上转型对象a来测试上转型对象的一些特性。

    public class A { private int a=1; public int getA() { return a; } public void setA(int a) { this.a = ...

  8. Checking For User Permissions Before Updating or Inserting The Records in Oracle Forms

    Suppose you want to check the user permissions on inserting or updating the records in Oracle Forms, ...

  9. Map Columns From Different Tables and Create Insert and Update Statements in Oracle Forms

    This is one of my most needed tool to create Insert and Update statements using select or alias from ...

  10. Oracle ——————建表、select、视图

    --建表 -- 关键字 : create -- 用法 : /* create table table_name ( lie1_name 数据类型 是否为空, lie2_name 数据类型 是否为空, ...