过度语法:

.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. android 模拟微信消息框 BaseAdapter()方法 [2]

    在昨天的微信布局的基础上加内容 http://www.cnblogs.com/Seven-cjy/p/6098024.html 项目下/res/layout下创建一个 listview_layout. ...

  2. mongodb 增加用户以及认证用户

    test>use admin switched to db admin admin>db.addUser('yshy','yshy') { "user" : " ...

  3. swipejs

    http://swipejs.com/ http://www.scoop.it/t/javascript-for-mobile http://www.open-open.com/news/view/c ...

  4. cf D. Broken Monitor

    http://codeforces.com/contest/370/problem/D 题意:输入一张图,上面只有两个字符'w'和‘.’ ,如果可以用一个正方形把所有的‘w’围起来,所有的‘w’都在正 ...

  5. 【C++基础之十一】虚函数的用法

    虚函数的作用和意义,就不进行说明了,这里主要讨论下虚函数的用法. 1.典型的虚函数用法 可以看到,只有标识为virtual的函数才会产生多态的效果,而且是编译多态.它只能借助指针或者引用来达到多态的效 ...

  6. VS013的单元测试去哪里了

    需要安装这个插件 http://visualstudiogallery.msdn.microsoft.com/45208924-e7b0-45df-8cff-165b505a38d7

  7. HDU5125--magic balls(LIS)

    题意:求a数组的LIS,但是加了一个条件,为了LIS最大 b[i] a[i]可以交换.最多交换mci: 赤果果的dp啊,可是这个题用线段树的话却会TLE,,由于查询的只是1-x的最大值 因此我们可以用 ...

  8. LeetCode-Word LadderII

    Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from ...

  9. Nmon 监控 Linux 的系统性能

    Nmon(得名于 Nigel 的监控器)是IBM的员工 Nigel Griffiths 为 AIX 和 Linux 系统开发的一款计算机性能系统监控工具.Nmon 可以把操作系统的统计数据展示在屏幕上 ...

  10. zoj3422Go Deeper(2-sat + 二分)

    题目请戳这里 题目大意: go(int dep, int n, int m) begin output the value of dep. if dep < m and x[a[dep]] + ...