首页 > 其他 > 详细

H5C3--过渡transition

时间:2018-01-13 12:25:19      阅读:284      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Title</title>
 6     <style>
 7         div{
 8             width: 200px;
 9             height: 200px;
10             background-color: red;
11             position: absolute;
12             left: 50px;
13             top: 50px;
14             /*过渡:过渡有延迟,有值的变化才能有过渡*/
15            /*
16             transition-property: 需要添加过渡效果的样式属性名称;  --必需
17             transition-duration: 过渡效果完成所需要的时长,以s为单位;  -- 必需
18             transition-delay: 延迟多少s后开始过渡 ;  -- 0
19             transition-timing-function:  过渡效果的时间函数--速度曲线;  --ease-in-out
20 
21             */
22             /*transition-property: left;
23             transition-duration: 1s;
24             transition-delay: 1s;
25             transition-timing-function: linear;*/
26 
27             /*transition-property: left,background-color;*/
28             /*transition-duration:  1s,10s;*/
29 
30             /*简写方式*/
31             /*transition: property duration delay timing-function;*/
32             /*transition: left 1s 1s linear , background-color 1s;*/
33 
34 
35             /*all 对所有属性都会运用过渡效果
36             1.遍历当前元素的所有可能的样式属性
37             2.降低效率
38             */
39             transition: all 1s 1s linear;
40         }
41         div:active{
42             left: 500px;
43             width: 400px;
44             background-color: #ceffbb;
45         }
46     </style>
47 </head>
48 <body>
49      <div></div>
50 </body>
51 </html>

 

技术分享图片

 

H5C3--过渡transition

原文:https://www.cnblogs.com/mrszhou/p/8278541.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!