CSS规模转换缓解不起作用

时间:2017-05-07 19:02:02

标签: html css css-transitions

所以我一直想在博客上的图标上进行这种规模转换。轻松的工作正常而不是缓和......我读了一些东西,但没有一个是关于规模转换的,所以我很难将它应用到我的案例中。 希望你能帮助我谢谢 这是我的代码:



#avatar {
margin:auto;
margin-top:15px;
width:50px;
height:50px;
border-radius:60px;
border:0px solid {color:Main icon background};
z-index:10;
}
 
#avatar img {
width:100%;
height:100%;
border-radius:100%;
}

#avatar img:hover{
-webkit-transition: all 0.7s ease-in;
-moz-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;  
-ms-transform: scale(1.5, 1.5); /* IE 9 */
-webkit-transform: scale(1.5, 1.5); /* Safari */
transform: scale(1.5, 1.5);
}

<div id="avatar"><img src="https://us.123rf.com/450wm/valentint/valentint1503/valentint150302008/37824182-examples-icon-internet-button-on-colored-background.jpg?ver=6"></div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:3)

更新了要包含的代码段

#avatar img {
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -ms-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}

使缓出过渡有效。

&#13;
&#13;
#avatar {
  margin: auto;
  margin-top: 15px;
  width: 50px;
  height: 50px;
  border-radius: 60px;
  border:0px solid {
    color: Main icon background
  }
  ;
  z-index:10;
}

#avatar img {
  width: 100%;
  height: 100%;
  border-radius: 100%;
}

#avatar img:hover {
  -webkit-transition: all 0.7s ease-in;
  -moz-transition: all 0.3s ease-in;
  -o-transition: all 0.3s ease-in;
  transition: all 0.3s ease-in;
  -ms-transform: scale(1.5, 1.5);
  /* IE 9 */
  -webkit-transform: scale(1.5, 1.5);
  /* Safari */
  transform: scale(1.5, 1.5);
}

#avatar img {
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -ms-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
&#13;
<div id="avatar"><img src="https://us.123rf.com/450wm/valentint/valentint1503/valentint150302008/37824182-examples-icon-internet-button-on-colored-background.jpg?ver=6"></div>
&#13;
&#13;
&#13;