zoukankan
html css js c++ java
CSS3动画效果示例
CSS3动画遵循@kwyframes规则,规定了动画的名称、时长。
1、示例代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3动画示例</title>
<style>
*{margin: 0;padding: 0}
section{100px;height: 100px;
background-color: coral;
position: relative;
animation: anim 3s infinite alternate;
-webkit-animation:anim 3s infinite alternate;
-moz-animation: anim 3s infinite alternate;
-o-animation: anim 3s infinite alternate;
margin: 50px auto; }
@keyframes anim {
0%{background-color: red;left: 0;top: 0;}
25%{background-color: green;left: 100px;top: 0;}
50%{background-color: blue;left: 100px;top: 100px;}
75%{background-color: yellow;left: 0;top: 100px;}
100%{background-color: purple;left: 0;top: 0;}
}
@-webkit-keyframes anim {
0%{background-color: red;left: 0;top: 0;}
25%{background-color: green;left: 100px;top: 0;}
50%{background-color: blue;left: 100px;top: 100px;}
75%{background-color: yellow;left: 0;top: 100px;}
100%{background-color: purple;left: 0;top: 0;}
}
@-moz-keyframes anim {
0%{background-color: red;left: 0;top: 0;}
25%{background-color: green;left: 100px;top: 0;}
50%{background-color: blue;left: 100px;top: 100px;}
75%{background-color: yellow;left: 0;top: 100px;}
100%{background-color: purple;left: 0;top: 0;}
}
@-o-keyframes anim {
0%{background-color: red;left: 0;top: 0;}
25%{background-color: green;left: 100px;top: 0;}
50%{background-color: blue;left: 100px;top: 100px;}
75%{background-color: yellow;left: 0;top: 100px;}
100%{background-color: purple;left: 0;top: 0;}
}
</style>
</head>
<body>
<section></section>
</body>
</html>
2.示例动画效果
查看全文
相关阅读:
jQuery插件主要有两种扩展方式
系统负载测试工具-LoadRunner
安全扫描工具-AppScan
newinstance()和new有什么区别?(转)
类的加载、连接和初始化 (转)
tar 基础
了解【重放攻击】
DDLDMLDCLDQL
web.xml的配置问题
组合与聚合
原文地址:https://www.cnblogs.com/qikeyishu/p/7394050.html
最新文章
扩展欧几里德算法
筛素数
LA 3516
带标号的连通图计数
UVa11137
多源最短路径---Floyd-Warshall算法
最少转机---图的广度优先遍历
城市地图---图的深度优先遍历求最短路径并输出所有路径
图的遍历---深度优先遍历与广度优先遍历
啊哈算法---水管工游戏
热门文章
啊哈算法---宝岛探险(深度优先搜索)着色法
啊哈算法---宝岛探险(深度优先搜索)
啊哈算法---宝岛探险(广度优先搜索)
用C++编一程序,先输出一行sun mon tue wed thu fri fri,接着使用右对齐打印出日期,像日历那样
将一个字符串,按照奇数位和偶数位分别存放到不同的字符串中
MongoDB学习笔记-命令
MongoDB学习笔记-基础概念
MongoDB学习笔记-认识MongoDB
简单理解集群,分布式,负载
随想-管理能力
Copyright © 2011-2022 走看看