<!DOCTYPE html>
<html>
<head>
<style>
/*
@-webkit-keyframes anim1 { // 规定动画。
0% {
Opacity: 0;
font-size: 12px;
}
100% {
Opacity: 1;
font-size: 34px;
}
}
.anim1Div {
-webkit-animation-name: anim1 ; 规定 @keyframes 动画的名称
-webkit-animation-duration: 1.5s; 规定动画完成一个周期所花费的秒或毫秒。默认是 0
-webkit-animation-iteration-count: 400; 规定动画被播放的次数。默认是 1。
-webkit-animation-direction: alternate; 规定动画是否在下一周期逆向地播放。默认是 "normal"。
-webkit-animation-timing-function: ease-in-out; 规定动画的速度曲线。默认是 "ease"。
} */ div
{
width:100px;
height:100px;
background:red;
position:relative; animation:myfirst 5s linear 2s infinite alternate;
/* Firefox: */
-moz-animation:myfirst 5s linear 2s infinite alternate;
/* Safari and Chrome: */
-webkit-animation:myfirst 5s linear 2s infinite alternate;
/* Opera: */
-o-animation:myfirst 5s linear 2s infinite alternate;
} @keyframes myfirst /* 需要用@keyframes来申明动画的名称*/
{/*从0%一直到100%的渐变过程*/
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-moz-keyframes myfirst /* Firefox */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-webkit-keyframes myfirst /* Safari and Chrome */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-o-keyframes myfirst /* Opera */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body> <p><b>注释:</b>本例在 Internet Explorer 中无效。</p> <div></div> </body>
</html>

css3中动画animation的应用的更多相关文章

  1. css3中动画(transition)和过渡(animation)详析

    css3中动画(transition)和过渡(animation)详析

  2. CSS3中动画属性transform、transition和animation

    Transform:变形 在网页设计中,CSS被习惯性的理解为擅长表现静态样式,动态的元素必须借助于javascript才可以实现,而CSS3的出现改变了这一思维方式.CSS3除了增加革命性的创新功能 ...

  3. CSS3中动画属性transform、transition 和 animation

    CSS3中和动画有关的属性有三个 transform.transition 和 animation.下面来一一说明:        transform   从字面来看transform的释义为改变,使 ...

  4. CSS3(4)---动画(animation)

    CSS3(4)---动画(animation) 之前有写过过渡:CSS3(2)--- 过渡(transition) 个人理解两者不同点在于 过渡 只能指定属性的 开始值 与 结束值,然后在这两个属性值 ...

  5. 怎样使CSS3中的animation动画当每滑到一屏时每次都运行

    这个得结合js来做的.比如这里有3个层,js判断滚动到当前层位置的时候给其加上一个class即可,而加的这个class就是带css3执行动画的 class <div id="a1&qu ...

  6. CSS3中动画transform必须要了解的Skew变化原理

    transform是CSS3中比较安全的动画(对于性能来说),其中有一些动画属性,来执行不同的变化.今天我们来了解skew的变化原理. skew,其实使用的频率不是很高,当然也没有最低.但是往往,一直 ...

  7. CSS3中的animation动画

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  8. 如何使CSS3中的animation动画当每滑到一屏时每次都运行

    这个我还没用过,但感觉以后会用到,就随手摘抄一下啦<div id="a1"></div> <div id="a2">< ...

  9. css3中的animation

    不使用js或jquery,用css3实现一张图片的滑动.我用的是animation来设置所要应用的动画效果,首先在html中写好一个<div></div>,并放置一张图片在di ...

随机推荐

  1. UVA 10570 Meeting with Aliens

    题意: N个外星人围成一桌坐下,有序的排列指N在N-1与N+1中间,现在给出一个序列,问至少交换几次可以得到有序的序列. 分析: 复制一遍输入序列,放在原序列之后.相当于环.通过枚举,可以把最小交换次 ...

  2. Oracle Dataguard三种保护模式概述(转)

    Oracle的DataGuard技术有三种实现模式,分别是max performance.max availability.max protection这三种模式. 以下是来自Oracle文档的摘要信 ...

  3. UILabel头文件常见属性

    text : default is nil 文本属性,默认值是 nil @property(nullable, nonatomic,copy) NSString *text; font : defau ...

  4. OC——封装(初级与高级)

    所谓的封装,就是通过定义方法或者函数去操作成员属性或者成员变量,而不是直接通过指针方式去操作.借此达到提高代码安全性,代码可行性以及代码执行效率的目的. 1:初级封装,对成员变量进行封装. #impo ...

  5. Qt5 多显示器获取不同显示器的分辨率和位置的方法

    Qt5 多显示器获取不同显示器的分辨率和位置的方法 先放官方文档链接:QDesktopWidget - Qt5 Reference 之前一直在用被我乱搞后的ShadowPlayer作为默认播放器,后来 ...

  6. 远程控制利器TeamViewer使用教程(图)

    TeamViewer是什么? 他是一款免费的可以穿透内网的远程控制软件,可以实现桌面共享,文件传送等功能,简单一点说就是和QQ远程协助一样,但是比QQ的远程协助功能更为强大. TeamViewer与木 ...

  7. Android周笔记(9.8-14)(持续更新)

    本笔记记录一周内的小知识点和一些心学习的Demo. 1.PopupWindow: new 一个activity_pop_window:id为popwindow的Button,id为hello123的T ...

  8. android玩耍(-) adbshell安装

    一 什么是adbshell http://adbshell.com/ Android Debug Bridge (adb) is a command line tool that lets you c ...

  9. C++ Primer第18章Vector的再实现及bug修正

    C++Primer第18.1.2节在介绍allocator类的时候,给了一个仿照标准库中vector的例子.感觉示例代码非常好,但是本人发现了一个bug,与大家共享. 按照作者的示例程序,编译程序时总 ...

  10. Java日期时间使用(转)

    Java日期时间使用总结 转自:http://lavasoft.blog.51cto.com/62575/52975/   一.Java中的日期概述   日期在Java中是一块非常复杂的内容,对于一个 ...