WordPress 头像旋转特效

Mruei 评论1,295字数 2694阅读8分58秒阅读模式

在当前主题的style.css最后添加如下代码:文章源自Eight Point-http://www.8oio.com/47.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); }

最后,刷新浏览器就可以看到头像旋转效果。文章源自Eight Point-http://www.8oio.com/47.html

 文章源自Eight Point-http://www.8oio.com/47.html

 文章源自Eight Point-http://www.8oio.com/47.html

文章源自Eight Point-http://www.8oio.com/47.html文章源自Eight Point-http://www.8oio.com/47.html
继续阅读
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证