有没有办法转换转换:scale属性只使用css?

时间:2015-08-03 18:23:46

标签: html css css3 css-transitions css-transforms

我正在使用

transform: scaleY(0.8);

在a:hover事件中。有没有办法随着时间的推移进行这种转变?我知道过渡事物的唯一方法就是

-webkit-transition: someparm sometime somefunction;
-moz-transition: someparm sometime somefunction;
-o-transition: someparm sometime somefunction;
transition: someparm sometime somefunction;

但是我无法弄清楚如何通过变换来实现它。

2 个答案:

答案 0 :(得分:0)

transition: transform 0.4s ease-in-out 0s;

transition-property: transform;
transition-duration: 0.4s;
transition-timing-function: ease-in-out;
transition-delay: 0s;

这样的事情

a {
  transform:scale(1);
  transition: transform 0.4s ease-in-out 0s;
}
a:hover {
    transform:scale(0.8);
}

答案 1 :(得分:0)

@keyframes scale {
    100% { transform:scaleY(0.8);}
    }

/* on hover */

abc:hover{
-webkit-animation:scale 3s ease infinite;
}

**尝试动画**