| 1234567891011121314151617181920212223242526272829303132333435 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- #box {
- width: 200px;
- height: 200px;
- background-color: red;
- /* 过渡:平滑的过渡
- transition:
- property 执行名称:all width height
- duration 时间 执行过渡的时间
- timing-function 执行的曲线:
- linear 规定以相同速度开始至结束的过渡效果(等于 cubic-bezier(0,0,1,1))。
- ease 规定慢速开始,然后变快,然后慢速结束的过渡效果(cubic-bezier(0.25,0.1,0.25,1))。
- ease-in 规定以慢速开始的过渡效果(等于 cubic-bezier(0.42,0,1,1))。
- ease-out 规定以慢速结束的过渡效果(等于 cubic-bezier(0,0,0.58,1))。
- ease-in-out 规定以慢速开始和结束的过渡效果(等于 cubic-bezier(0.42,0,0.58,1))。
- delay 延迟时间
- */
- transition:all 3s linear 5s;
- }
- #box:hover {
- width: 500px;
- height: 700px;
- }
- </style>
- </head>
- <body>
- <div id="box"></div>
- </body>
- </html>
|