过度语法:

.example {
transition-property: background-color; //需要过度的css属性
transition-duration: 2s; //过度所需要的时间
transition-timing-function: ease-in; //过度的类型
transition-delay: 1s; //过度延迟的时间
} 大家都知道css代码是要简写的:
过渡简写: example {
transition: background-color 2s ease-in 1s;
} 多项过度: .example {
transition: background-color 2s ease-in 1s,
width 2s ease-in-out,
height 3s ease-out;
} 触发事件过渡:----例如 click hover 类似的事件 、背景过度,一个背景为绿色当鼠标hover时延迟1s过度到蓝色;
.example {
background-color: green;
transition: background-color 2s ease-in 1s;
}
.example:hover {
background-color: blue
} 、当用户单击并按住元素时,发生宽度属性过渡,因此该元素保持 "活动" 状态。
.example {
width: 200px;
height: 200px;
transition: width 2s ease-in;
}
.example:active {
width: 400px;
} 、当你输入元素的时候input会变宽;
input {
width: 200px;
transition: width 2s ease-in;
}
input:focus {
width: 250px;
} 、可以几个属性同时进行变化;
.example {
width: 200px;
height: 200px;
background:#;
-webkit-transition: width 2s ease,
height 2s ease, background 2s ease;
-webkit-transform: translateZ();
}
.example:hover {
width: 300px;
height: 300px;
background:green;
}
  CSS代码:
[css]
#timings-demo {border: 1px solid #ccc;padding: 10px;height: 400px;width: 400px;}
.box {width: 100px;height: 50px;line-height: 50px;text-align: center;color: #fff;margin-bottom: 10px;
-webkit-border-radius: 5px;
-webkit-box-shadow: inset 5px rgba(, , ,0.5);
}
/*逐渐变慢效果:*/
#ease {background: #f36;
-webkit-transition: all 5s ease .3s;
}
/*加速效果:*/
#ease-in {background: #;
-webkit-transition: all 3s ease-in .5s;
}
/*减速效果:*/
#ease-out {background: #;
-webkit-transition: all 5s ease-out 0s;
}
/*先加速然后减速效果:*/
#ease-in-out {background: #3e6;
-webkit-transition: all 1s ease-in-out 2s;
}
/*匀速效果:*/
#linear { background: #;
-webkit-transition: all 6s linear 0s;
}
/*该值允许你去自定义一个时间曲线效果:*/
#cubic-bezier {background: #6d6;
-webkit-transition: all 4s cubic-bezier 1s;
}
/*hover状态下或单击click按钮后box产生属性变化*/
#timings-demo:hover .box {
-webkit-transform: rotate(360deg) scale(1.2);
-webkit-border-radius: 25px;
}

transition Css3过度详解的更多相关文章

  1. 转:【译】CSS3:clip-path详解

    我的一个学生,Heather Banks,想要实现他在Squarespace看到的一个效果: 根据她的以往经验,这个网站的HTML和CSS是完全在她的能力范围以内,于是我帮助她完成了这个效果.显示na ...

  2. CSS3过渡详解-遁地龙卷风

    第二版 0.环境准备 (1)过渡需要浏览器的支持,使用这些属性要加上浏览器厂商的前缀,我用的chrome49已经不需要前缀了, -o- Opera -webkit- Safari.Chrome -mo ...

  3. CSS3 transition 属性过渡效果 详解

    CSS3 transition 允许 CSS 元素的属性值在一定的时间区间内平滑地过渡.我们可以在不使用 Flash 动画或 JavaScript 的情况下,在元素从一种样式变换为另一种样式时为元素添 ...

  4. CSS3动画详解(超详细)

    本文最初发表于博客园,并在GitHub上持续更新前端的系列文章.欢迎在GitHub上关注我,一起入门和进阶前端. 以下是正文. 前言 本文主要内容: 过渡:transition 2D 转换 trans ...

  5. CSS3动画详解(图文教程)

    本文最初发表于博客园,并在GitHub上持续更新前端的系列文章.欢迎在GitHub上关注我,一起入门和进阶前端. 以下是正文. 前言 本文主要内容: 过渡:transition 2D 转换 trans ...

  6. 第四十一课:CSS3 animation详解

    animation是css3的另一个重要的模块,它成型比transition晚,吸取了Flash的关键帧的理念,实用性高. animation是一个复合样式,它可以细分为8个更细的样式. (1)ani ...

  7. CSS3属性详解(图文教程)

    本文最初发表于博客园,并在GitHub上持续更新前端的系列文章.欢迎在GitHub上关注我,一起入门和进阶前端. 以下是正文. 前言 我们在上一篇文章中学习了CSS3的选择器,本文来学一下CSS3的一 ...

  8. CSS3动画详解(结合实例)

    一.使用CSS3动画代替JS动画 JS动画频繁操作DOM导致效率非常低 在频繁的操作DOM和CSS时,浏览器会不停的执行重排(reflow)和重绘(repaint) 可以避免占用JS主线程 这边就不细 ...

  9. CSS3 HSL()详解:

    这是CSS3新增的颜色表示模式.在CSS2中,只有RGB(red.green和blue的缩写)和十六进制两种颜色模式.为了能够支持颜色的透明度,CSS3新增了RGBA(A是Alpha缩写).但是无论是 ...

随机推荐

  1. win7 64位 python3.4&opencv3.0配置安装

    参考:http://blog.csdn.net/sun7_she/article/details/50051249 一.安装Python 下载Python3.4.2 网址:https://www.py ...

  2. DbUtility-关于DataTable转成List的效率问题

    DbUtility中的方法ExecuteDataTableAsync()得到的是一个DataTable,而我们常见的情况下,我们需要的不是DataTable,而是List或IList,所以现在需要考虑 ...

  3. hdu 2992 Hotel booking

    http://acm.hdu.edu.cn/showproblem.php?pid=2992 #include <cstdio> #include <cstring> #inc ...

  4. Ruby on Rails Tutorial读书笔记-1

    只是怕忘了命令,全部撸一次,记个大概.. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 安装Ruby之前,先要安装RVM: curl -L https://get.rvm.io | bas ...

  5. FE: CSS固定图片显示大小及GitHub Pages在线演示

    CSS固定图片显示大小 分析 假设图片区域的大小固定为250×300px,那么我们可以写出如下的样式 .picture-area { width: 250px; height: 300px; marg ...

  6. COJ 0802 非传统题(二)

    (颓了这么多天是时候干点正事了QAQ) 非传统题(二) 难度级别:B: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 还是很久很久以前,chx ...

  7. [HNOI 2013] 消毒 (搜索,二分图匹配)

    题目大意 一个a * b * c(a * b * c <= 5000)大小的长方体中有一些点需要被覆盖,每次可以选择任意大小的长方体,覆盖其中的点,产生的代价为这个长方体长宽高中最小的那个的长度 ...

  8. js点击按钮,放大对应图片代码

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. java foreach记录

    实现原理解释: http://blog.csdn.net/a596620989/article/details/6930479 http://stackoverflow.com/questions/8 ...

  10. Java组合与继承生成的类中构造函数的执行顺序

    [程序实例] import java.util.*; class Meal{ Meal() { System.out.println("Meal Constructor"); } ...