本文共 1045 字,大约阅读时间需要 3 分钟。
方法很简单,在/wp-content/themes/目录下,找到你当前使用的主题的文件夹,进入后,找到style.css,将下面的代码复制后,粘贴到style.css文件的最下面,然后保存即可:
.avatar{float:left;margin-right:8px;padding:1px;border:1px solid #cfd9e1;width:40px;height:40px; /*设置图像的长和宽*/ 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); }上面是我使用的设置,修改的时候,可以根据上面绿色的注释进行修改,比如头像的大小,旋转的角度,时间等等
转载地址:http://wtnmb.baihongyu.com/