| 123456789101112131415161718192021222324252627282930313233 |
- <!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: blue;
- margin:100px auto;
- /* transition 为元素添加过度效果 */
- /* 后面有3个值 第一个控制过度的属性 第二个参数过度所需用时 第三个参数过度效果*/
- /* transition: all 0.5s linear; */
- /* transition-property 过度属性 */
- transition-property: width;
- /* transition-duration 过度时间 */
- transition-duration: 1s;
- /* transition-timing-function 过度效果 */
- transition-timing-function: linear;
- }
- .box:hover{
- /* transform: rotate(45deg); */
- width: 100px;
- height: 400px;
- }
- </style>
- </head>
- <body>
- <div class="box"></div>
- </body>
- </html>
|