css3中动画animation的应用
<!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的应用的更多相关文章
- css3中动画(transition)和过渡(animation)详析
css3中动画(transition)和过渡(animation)详析
- CSS3中动画属性transform、transition和animation
Transform:变形 在网页设计中,CSS被习惯性的理解为擅长表现静态样式,动态的元素必须借助于javascript才可以实现,而CSS3的出现改变了这一思维方式.CSS3除了增加革命性的创新功能 ...
- CSS3中动画属性transform、transition 和 animation
CSS3中和动画有关的属性有三个 transform.transition 和 animation.下面来一一说明: transform 从字面来看transform的释义为改变,使 ...
- CSS3(4)---动画(animation)
CSS3(4)---动画(animation) 之前有写过过渡:CSS3(2)--- 过渡(transition) 个人理解两者不同点在于 过渡 只能指定属性的 开始值 与 结束值,然后在这两个属性值 ...
- 怎样使CSS3中的animation动画当每滑到一屏时每次都运行
这个得结合js来做的.比如这里有3个层,js判断滚动到当前层位置的时候给其加上一个class即可,而加的这个class就是带css3执行动画的 class <div id="a1&qu ...
- CSS3中动画transform必须要了解的Skew变化原理
transform是CSS3中比较安全的动画(对于性能来说),其中有一些动画属性,来执行不同的变化.今天我们来了解skew的变化原理. skew,其实使用的频率不是很高,当然也没有最低.但是往往,一直 ...
- CSS3中的animation动画
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- 如何使CSS3中的animation动画当每滑到一屏时每次都运行
这个我还没用过,但感觉以后会用到,就随手摘抄一下啦<div id="a1"></div> <div id="a2">< ...
- css3中的animation
不使用js或jquery,用css3实现一张图片的滑动.我用的是animation来设置所要应用的动画效果,首先在html中写好一个<div></div>,并放置一张图片在di ...
随机推荐
- 各版本SDK Tools及ADT下载技巧
我们在开发的时候,尤其是使用Eclipse安装ADT插件进行环境配置,我们需要从下载ADT插件及SDK,当我们从官网下载的时候,有的时候可能找不到下载的地方或者下载不到自己想要的版本,我就在此总结下如 ...
- WampServer2.5的XDebug调试不成功的原因
WampServer2.5的php.ini文件位置很奇妙,除了在“wamp\bin\php\php5.5.12”目录下有一个外,“wamp\bin\apache\apache2.4.9\bin”目录下 ...
- SVN(一次检出&二次检出)
一次检出: >进入经历文件夹 >输入svn checkout指令 >输入电脑密码 >输入用户名 >输入密码 >检出成功 第二次检出: >进入小涛文件夹 > ...
- js实现超过长度的字符截取指定长度(中文字符算2个字符),超出部分以...显示
//超过长度的字符截取指定长度,超出部分以...显示 function subString(str, len) { var newLength = 0; var newStr = "&quo ...
- Hadoop学习资料收集
1.漫画HDFS工作原理 http://blog.csdn.net/netcoder/article/details/7442779 2.马哥教育 http://mageedu.blog.51cto ...
- PHP不显示报错了怎么办~
php.ini里设置吧, 找到 display_errors, 设置成on, error_reporting = E_ALL
- 14-利用SVD简化数据
参考:http://blog.csdn.net/geekmanong/article/details/50494936 http://www.2cto.com/kf/201503/383087.htm ...
- PNPOLY - Point Inclusion in Polygon W. Randolph Franklin
测试目标点是否在多边形内int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy) { int i, j, ...
- Oracle EBS-SQL (PO-10):检查过期采购未接收订单.sql
Select pha.segment1 采购订单, MSI.SEGMENT1 物料编码, MSI.DESC ...
- 忘记linux密码
http://blog.163.com/xygzlyq@126/blog/static/22585899200810471512530/