所以我试图让图像在“悬停”时旋转 360 次。但不幸的是它不是,我认为这可能是因为我使用了背景元素来显示图像,但我想不出如何以其他方式显示图像。
使用 bootstrap 3,不确定如何使用 glyphicons
<div class="services">
<i class="icon-html5"></i>
<h4 class="service-heading">HTML5</h4>
<p>Developed with high level of coding and care to provide everyone with a HTML5 compliant markup.</p>
</div>
.services{
background-color:#F5F5F5;
border-radius: 5px 5px 5px 5px;
cursor: pointer;
margin:60px 0;
padding:14px;
position: relative;
}
.services i{
border:10px solid #FFFFFF;
border-radius: 50% 50% 50% 50%;
color:#F4F4F4;
font-size: 18px;
height:100%;
left:50%;
line-height: 100%;
margin: -60px 0 0 -60px !important;
padding:0 !important;
position: absolute;
top:0px;
transition: all 0.3s ease-in-out 0s;
width:140px;
background-color:#F47E7E;
}
.services:hover > i{
animation: 1.5s linear 0s normal none infinite spinAround;
border: 10px solid #FFFFFF;
}
.icon-html5{
background-image: url('../img/html5.png');
background-repeat: no-repeat;
animation: 1.5s linear 0s normal none infinite spinAround;
border: 10px solid #FFFFFF;
background-position:center;
}
JS 小提琴 - http://jsfiddle.net/MJXrM/1/
谢谢!