CSS3提供的transition动画

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 背景色变化</title>
<style>
div {
width:600px;
height:40px;
border:2px solid #000;
padding:6px;
font-size:18px;
background:#b9f7b4;
margin:3px auto;
}
.t1{
-moz-transition:background-color 4s linear;
-webkit-transition:background-color 4s linear;
-o-transition:background-color 4s linear;
}
.t1:hover {
background:#808080;
}
.t2 {
-moz-transition:background-color 4s ease;
-webkit-transition:background-color 4s ease;
-o-transition:background-color 4s ease;
}
.t2:hover {
background:#ffd800;
}
.t3 {
-moz-transition:background-color 4s ease-in;
-webkit-transition:background-color 4s ease-in;
-o-transition:background-color 4s ease-in;
}
.t3:hover {
background:#ffd800;
}
.t4 {
-moz-transition:background-color 4s ease-out;
-webkit-transition:background-color 4s ease-out;
-o-transition:background-color 4s ease-out;
}
.t4:hover {
background:#ffd800;
}
.t5 {
-moz-transition:background-color 4s ease-in-out;
-webkit-transition:background-color 4s ease-in-out;
-o-transition:background-color 4s ease-in-out;
}
.t5:hover {
background:#ffd800;
}
.t6 {
-moz-transition:background-color 4s ease;
-webkit-transition:background-color 4s ease;
-o-transition:background-color 4s ease;
-moz-transition:width 4s ease;
-webkit-transition:width 4s ease;
-o-transition:width 4s ease;
}
.t6:hover {
width:200px;
background:#ffd800;
}
</style>
</head>
<body>
<p style="width:600px; margin:0 auto; font-size:24px; font-weight:bold">
1 transition-property:指定对HTML元素的那个CSS属性进行平滑渐变处理。
该属性可以指定background-color、width、height等各种标准的CSS属性<br />
2 transition-duration:指定属性平滑渐变的持续时间<br />
3 transition-time-function:指定渐变的速度
</p>
<p style="width:600px; height:40px; color:#f00; margin:0 auto; font-size:24px; font-weight:bold">鼠标移上来会发生颜色渐变</p>
<div class="t1">linear:线性速度。动画开始的速度到结束的速度保持不变</div>
<div class="t2">ease:动画开始时较慢,然后速度加快,到达最大的速度之后再减速</div>
<div class="t3">ease-in:动画开始时速度较慢,然后速度加快</div>
<div class="t4">ease-out:动画开始时很快,然后速度减速</div>
<div class="t5">ease-in-out:动画开始时较慢,然后速度加快,到达最大速度时再减慢速度</div>
<div class="t6">宽度由600px变为200px;背景由浅蓝变为黄色;ease</div>
</body>
</html>
CSS3提供的transition动画的更多相关文章
- css3 Transition动画执行时有可能会出现闪烁的bug
css3 Transition动画执行时有可能会出现闪烁的bug,一般出现在开始的时候. 解决方法: 1.-webkit-backface-visibility: hidden; 2.-webkit- ...
- CSS3的transition动画功能
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- css3中变形与动画(一)
css3制作动画的几个属性:变形(transform),过渡(transition)和动画(animation). 首先介绍transform变形. transform英文意思:改变,变形. css3 ...
- 非常酷的CSS3垂直下拉动画菜单
昨天我向大家介绍了一款兼容性不错的jQuery淡入淡出下拉菜单,今天要分享一款相对绚丽的CSS3垂直下拉动画菜单,不过需要支持CSS3的浏览器才能有效果.下面是效果图,一起看看. 我们也可以在这里查看 ...
- css3中的制作动画小总结
系列教程 CSS3属性中有关于制作动画的三个属性:Transform,Transition,Animation: Transform 在CSS3中transform主要包括以下几种:旋转rotate. ...
- CSS3全览_动画+滤镜
CSS3全览_动画+滤镜 目录 CSS3全览_动画+滤镜 1. 列表和生成的内容 2. 变形 3. 过渡 4. 动画 5. 滤镜, 混合, 裁剪和遮罩 6. 针对特定媒体的样式 作者: https:/ ...
- css3中变形与动画(三)
transform可以实现矩阵变换,transition实现属性的平滑过渡,animation意思是动画,动漫,这个属性才和真正意义的一帧一帧的动画相关.本文就介绍animation属性. anima ...
- 移动端 transition动画函数的封装(仿Zepto)以及 requestAnimationFrame动画函数封装(仿jQuery)
移动端 css3 transition 动画 ,requestAnimationFrame 动画 对于性能的要求,h5优先考虑: 移动端 单页有时候 制作只用到简单的css3动画即可,我们封装一下, ...
- [CSS3] 学习笔记-CSS动画特效
在CSS3中,出现了很多出彩的效果,例如2D.3D以及过度.动画和多列等.这些效果为页面设计添加了很多的可选设计. 1.2D.3D转换 转换,是使元素改变尺寸.形状.位置的一种效果:通过CSS3转换, ...
随机推荐
- 20145122《Java面向对象程序设计》实验二实验报告
实验名称: Java面向对象程序设计 实验内容: 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 PSP时间 步骤 ...
- Windows中的时间(SYSTEMTIME和FILETIME) (转载)
转载:http://blog.csdn.net/bokee/article/details/5330791 两种时间系统之间没有本质区别(事实上CRT时间是用Windows时间实现的,当然这是说的VC ...
- CocoaPods的安装及使用
CocoaPods安装使用及配置私有库 http://www.exiatian.com/cocoapods%E5%AE%89%E8%A3%85%E4%BD%BF%E7%94%A8%E5%8F%8A%E ...
- Leetcode ——Lowest Common Ancestor of a Binary Tree
Question Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. ...
- python 字符串转变量方法
1.response=eval('requests.'+func.lower())(destURL, headers=requestHeaders, data=postData, params=que ...
- 怎样借助Python爬虫给宝宝起个好名字--python 学习
每个人一生中都会遇到一件事情,在事情出现之前不会关心,但是事情一旦来临就发现它极其重要,并且需要在很短的时间内做出重大决定,那就是给自己的新生宝宝起个名字. 因为要在孩子出生后两周内起个名字(需要办理 ...
- python 判断字符串是否以数字结尾
import re def end_num(string): #以一个数字结尾字符串 text = re.compile(r".*[0-9]$") if text.match(st ...
- shell 余弦值转角度
范例:余弦值转角度 用 bc -l 计算,可以获得高精度: $ export cos=0.996293; echo "scale=100; a(sqrt(1-$cos^2)/$cos)*18 ...
- Eclipse打JAR包,插件FatJar安装与使用
下载fatJar插件,解压缩后是一个.../plugins/(net...)把plugins下面的(net..)文件夹拷贝到eclipse 的plugins下,重新启动Eclipse3.1,Windo ...
- Eclipse 打包jar
1.将项目打成jar: 1.1 要将项目打包成jar文件,方法很多,可以用Eclipse自带的打包工具Ant打包,也可以用Eclipse的Export生成jar.经过尝试后,我不推荐用Ant打包,因为 ...