5_过度.html 871 B

12345678910111213141516171819202122232425262728293031
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. .box{
  9. width: 100px;
  10. height: 100px;
  11. background-color: red;
  12. /*transition 过度 第一个值监听哪个属性的变化 第二过度时间 第三过度方式*/
  13. /* transition: width 1s linear; */
  14. /* transition-property: width;
  15. transition-duration: 1s;
  16. transition-timing-function: linear; */
  17. /* all 表示监听所有属性的变化 */
  18. transition: all 1s linear;
  19. }
  20. .box:hover{
  21. width: 400px;
  22. background-color: blue;
  23. height: 400px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div class="box"></div>
  29. </body>
  30. </html>