我确实在按钮上尝试过,也应该在图像上工作。这就是你所需要的。
注意:此代码仅使用 CSS 和 HTML 来制作您想要的内容。
input#round{
width:100px; /*same as the height*/
height:100px; /*same as the width*/
background-color:#05B7FF;
border:1px solid #05B7FF; /*same colour as the background*/
color:#fff;
font-size:1.6em;
/*initial spin*/
-moz-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
/*set the border-radius at half the size of the width and height*/
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
/*give the button a small drop shadow*/
-webkit-box-shadow: 0 0 10px rgba(0,0,0, .75);
-moz-box-shadow: 0 0 10px rgba(0,0,0, .75);
box-shadow: 2px 2px 15px rgba(0,0,0, .75);
-webkit-transition:-webkit-transform 1s,opacity 1s,background 1s,width 1s,height 1s,font-size 1s;
-o-transition-property:width,height,-o-transform,background,font-size,opacity,color;
-o-transition-duration:1s,1s,1s,1s,1s,1s,1s;
-moz-transition-property:width, height, -moz-transform, background, font-size, opacity, color;
-moz-transition-duration:1s,1s,1s,1s,1s,1s,1s;
transition-property:width,height,transform,background,font-size,opacity;
transition-duration:1s,1s,1s,1s,1s,1s;
display:inline-block;
}
/***NOW STYLE THE BUTTON'S HOVER STATE***/
input#round:hover{
background:#007DC5;
border:1px solid #007DC5;
/*reduce the size of the shadow to give a pushed effect*/
-webkit-box-shadow: 0px 0px 5px rgba(0,0,0, .75);
-moz-box-shadow: 0px 0px 5px rgba(0,0,0, .75);
box-shadow: 0px 0px 5px rgba(0,0,0, .75);
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
它还有其他几个漂亮的功能,如推送效果。值得尝试。亲切。
注意:您可以编辑过渡持续时间,然后编辑另一个动画。它由您调用。