2016年11月10日--CSS动画

jquery动画:http://www.w3school.com.cn/jquery/jquery_animate.asp
CSS3动画教程1:http://www.w3school.com.cn/css3/css3_animation.asp
CSS3动画教程2:http://www.runoob.com/css3/css3-animations.html

.

CSS3的动画属性

下面的表格列出了 @keyframes 规则和所有动画属性:

属性 描述 CSS
@keyframes 规定动画。 3
animation 所有动画属性的简写属性,除了 animation-play-state 属性。 3
animation-name 规定 @keyframes 动画的名称。 3
animation-duration 规定动画完成一个周期所花费的秒或毫秒。默认是 0。 3
animation-timing-function 规定动画的速度曲线。默认是 "ease"。 3
animation-delay 规定动画何时开始。默认是 0。 3
animation-iteration-count 规定动画被播放的次数。默认是 1。 3
animation-direction 规定动画是否在下一周期逆向地播放。默认是 "normal"。 3
animation-play-state 规定动画是否正在运行或暂停。默认是 "running"。 3

运行下面的动画,其中设置了所有动画属性:

<!DOCTYPE html>
<html>
<head>
<style>
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation-name:myfirst;
animation-duration:5s;
animation-timing-function:linear;
animation-delay:2s;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-play-state:running;
/* Firefox: */
-moz-animation-name:myfirst;
-moz-animation-duration:5s;
-moz-animation-timing-function:linear;
-moz-animation-delay:2s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:alternate;
-moz-animation-play-state:running;
/* Safari and Chrome: */
-webkit-animation-name:myfirst;
-webkit-animation-duration:5s;
-webkit-animation-timing-function:linear;
-webkit-animation-delay:2s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:alternate;
-webkit-animation-play-state:running;
/* Opera: */
-o-animation-name:myfirst;
-o-animation-duration:5s;
-o-animation-timing-function:linear;
-o-animation-delay:2s;
-o-animation-iteration-count:infinite;
-o-animation-direction:alternate;
-o-animation-play-state:running;
}

@keyframes myfirst
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

@-moz-keyframes myfirst /* Firefox */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

@-webkit-keyframes myfirst /* Safari and Chrome */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

@-o-keyframes myfirst /* Opera */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body>

<p><b>注释:</b>本例在 Internet Explorer 中无效。</p>

<div></div>

</body>
</html>
时间: 2025-01-09 01:48:34

2016年11月10日--CSS动画的相关文章

struts2练习时犯的错误(2016年11月4日)

1.Tomcat启动时报错 严重: 文档无效: 找不到语法. at (null:3:8) org.xml.sax.SAXParseException; systemId: file:/F:/Program%20Files%20(x86)/Tomcat%206.0/webapps/struts2_11_4/WEB-INF/classes/struts.xml; lineNumber: 3; columnNumber: 8; 文档无效: 找不到语法. 错误原因:struts.xml中忘记写<!DOC

学习笔记(11月10日)--python常用内置模块的使用(logging, os, command)

四周五次课(11月10日) 一. logging 日志是我们排查问题的关键利器,写好日志记录,当我们发生问题时,可以快速定位代码范围进行修改.Python给我们开发者们提供了好的日志模块,下面我们就来介绍一下logging模块: 首先,我们先来看一个例子: import logging logging.debug('This is debug message') logging.info('This is info message') logging.warning('This is warni

11月10日直播:EVE-NG模拟器入门和老司机心得分享,你来不来?

大家好. 今天要告诉你们一个好消息,本周六11月10号早上10点到11点. 我计划开一个直播和你们一起聊聊如何入门EVE-NG模拟器. 说起EVE-NG,相信很多人都多多少少听说过. 它和GNS3,以及思科的VIRL,Packet-tracer一样,均算是设备仿真一类的软件. 说白了就是模拟器. 但是EVE-NG相比GNS3,我个人认为使用体验和便捷程度更上一层楼. 所以从2017年开始,我就已经慢慢把自己的网络模拟器从GNS3迁移到EVE-NG. 因此我在写<老司机网络运维集锦>以及<

2016年11月19日 星期六 --出埃及记 Exodus 20:10

but the seventh day is a Sabbath to the LORD your God. On it you shall not do any work, neither you, nor your son or daughter, nor your manservant or maidservant, nor your animals, nor the alien within your gates. 但第七日是向耶和华你 神当守的安息日.这一日你和你的儿女,仆婢,牲畜,并

2016年11月20日--存储过程、视图

存储过程: 存储过程(stored procedure)有时也称为sproc.存储过程存储于数据库中而不是在单独的文件中,有输入参数.输出参数以及返回值等. 在数据库中,创建存储过程和创建其他对象的过程一样,除了它使用的AS关键字外. create proc 存储过程名  --创建存储过程   或    alter proc 存储过程名  --  修改存储过程 参数1 参数类型,参数2 参数类型……参数n 参数类型 as begin---  ={ 查.插.删.改 end---  =} 1 --存

C++第十四天笔记2016年03月10日(周四) A.M

1. 线性结构:链表和数组 数组:可以访问任意位置的元素.添加删除操作相对麻烦. 链表:添加删除效率相对较高.只能从第一个元素开始访问. 访问较多:数组.添加删除较多:链表. 数组:元素类型 数组名[元素个数]; 2.  如何创建链表: 链表:链表中的每一个元素称为节点. 节点:数据域(存储数据)和指针域(存储下一节点的地址编号). 3.  双向链表:数据域和指针域(包含两个,其中一个指向下一个节点,另外一个指向上一个节点) 4.  头结点:链表中的第一个节点 空链表:链表中无任何节点. 1 #

2016年11月14日--SQL创建数据库、表-查、插、删、改

--创建数据库create database hq20161114go --使用数据库use hq20161114go --创建学生表create table xuesheng(code int,name varchar(10),sex char(10),chengji decimal(18,2)) --添加学生信息insert into xuesheng values(1001,'一','男',11)insert into xuesheng values(1002,'二','男',22)ins

11月10日上午ajax基础知识、用ajax做登录页面、用ajax验证用户名是否可用、ajax动态调用数据库

1.ajax的基础知识 ajax是结合了jquery.php等几种技术延伸出来的综合运用的技术,不是新的内容.ajax也是写在<script>标签里面的. 如果使用ajax一定是要有1个处理页面的,处理页面只是操作数据库并且返回值,页面都是ajax处理的. ajax的写法: test.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR

11月10日下午 ajax做显示信息以后用ajax、Bootstrp做弹窗显示信息详情

1.用ajax做弹窗显示信息详情 nation.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <me