WordPress 头像旋转特效

EightPoint
EightPoint
管理员
67
文章
0
粉丝
数智软件评论142字数 200阅读0分40秒阅读模式

在当前主题的style.css最后添加如下代码:文章源自八点运动-https://www.8oio.com/50.html

  1. .avatar{float:left;margin-right:8px;padding:1px;border:1px solid #cfd9e1;width:100px;height:100px; /*设置图像的长和宽*/
  2. border-radius: 20px;/*设置图像圆角效果,在这里我直接设置了超过width/2的像素,即为圆形了*/
  3. -webkit-border-radius: 20px;/*圆角效果:兼容webkit浏览器*/
  4. -moz-border-radius:20px;
  5. box-shadow: inset 0 -1px 0 #3333sf;/*设置图像阴影效果*/
  6. -webkit-box-shadow: inset 0 -1px 0 #3333sf;
  7. -webkit-transition: 0.4s;
  8. -webkit-transition: -webkit-transform 0.4s ease-out;
  9. transition: transform 0.4s ease-out;/*变化时间设置为0.4秒(变化动作即为下面的图像旋转360度)*/
  10. -moz-transition: -moz-transform 0.4s ease-out;
  11. }
  12. .avatar:hover{/*设置鼠标悬浮在头像时的CSS样式*/
  13. box-shadow: 0 0 10px #fff; rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1);
  14. -webkit-box-shadow: 0 0 10px #fff; rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1);
  15. transform: rotateZ(360deg);/*图像旋转360度*/
  16. -webkit-transform: rotateZ(360deg);
  17. -moz-transform: rotateZ(360deg); }

最后,刷新浏览器就可以看到头像旋转效果。文章源自八点运动-https://www.8oio.com/50.html 文章源自八点运动-https://www.8oio.com/50.html

 最后更新:2025-2-25
匿名

发表评论

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

拖动滑块以完成验证
加载中...