CSS 3 过渡-transition_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:17:58
Original
939 people have browsed it

CSS 3 过渡

=====================================================================================

过渡---一个元素在不同状态之间进行平滑的转换,CSS 3 中使用transition属性实现过渡效果。


transition :过渡属性  执行时间  时间函数 延时时间;



时间函数---设置元素运动的速度

(1)贝塞尔曲线  cubic-bezier(p1(x,y),p2(x,y))

预定义贝塞尔曲线:

ease(默认值)

linear

ease-in

ease-out

ease-in-out

(2) steps()

step-start  //步数为一

step-end


=======================================================================================================================================================================================

示例一:

img:hover{    transform: translate(600px);}img{    transition:2s cubic-bezier(0.6,0.1,0.1,0.7);}
Copy after login


示例二:

<style>        div:hover img{            transform:translate(300px);        }        .i01{            transition:2s steps(3,start);        }        .i02{            transition:2s steps(3,end);        }        .i03{            transition:2s linear;        }    </style>
Copy after login
    <div>        <img src="images/caffe-1.jpg" alt="" class="i01"/><br/>        <img src="images/caffe-2.jpg" alt="" class="i02"/><br/>        <img src="images/caffe-3.jpg" alt="" class="i03"/>    </div>
Copy after login


===========transition属性的每一步都可以用单独的属性表示

    transition: all 2s linear 3s;
Copy after login
    transition-property: all;    transition-duration: 2s;    transition-timing-function: linear;    transition-delay: 3s;
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template