CSS3 transition 属性

作用:transition 用于实现过渡效果。

语法:transition: property duration timing-function delay;

    默认值 :all 0 ease 0

     property   指定CSS属性的name

    duration   过渡动画持续的时间 (秒)

    timing-function  过渡动画的运动曲线

    delay  等待多少秒后开始执行动画效果

举个栗子:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>transition过渡动画</title>
  <style>
    .box {
      width: 100px;
      height: 100px;
      background: blue;
      transition: all 2s linear;
    }
    .box:hover {
      width: 200px;
      height: 200px;
    }
  </style>
</head>
<body>
  <div class="box"></div>
</body>
</html>

 

猜你喜欢

转载自www.cnblogs.com/lqw007/p/9577365.html