在当前主题的style.css最后添加如下代码:文章源自八点运动-https://www.8oio.com/50.html
.avatar{float:left;margin-right:8px;padding:1px;border:1px solid #cfd9e1;width:100px;height:100px; /*设置图像的长和宽*/ border-radius: 20px;/*设置图像圆角效果,在这里我直接设置了超过width/2的像素,即为圆形了*/ -webkit-border-radius: 20px;/*圆角效果:兼容webkit浏览器*/ -moz-border-radius:20px; box-shadow: inset 0 -1px 0 #3333sf;/*设置图像阴影效果*/ -webkit-box-shadow: inset 0 -1px 0 #3333sf; -webkit-transition: 0.4s; -webkit-transition: -webkit-transform 0.4s ease-out; transition: transform 0.4s ease-out;/*变化时间设置为0.4秒(变化动作即为下面的图像旋转360度)*/ -moz-transition: -moz-transform 0.4s ease-out; } .avatar:hover{/*设置鼠标悬浮在头像时的CSS样式*/ box-shadow: 0 0 10px #fff; rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1); -webkit-box-shadow: 0 0 10px #fff; rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1); transform: rotateZ(360deg);/*图像旋转360度*/ -webkit-transform: rotateZ(360deg); -moz-transform: rotateZ(360deg); }
最后,刷新浏览器就可以看到头像旋转效果。文章源自八点运动-https://www.8oio.com/50.html 文章源自八点运动-https://www.8oio.com/50.html