知更鸟主题给评论头像添加旋转变圆特效

wp美化329.1K views阅读模式

知更鸟主题给评论头像添加旋转变圆特效

知更鸟主题原来的特效在鼠标经过的时候是并不会变成圆的,也没有如图显示的绿色阴影效果。

在原来的基础如你所见,是在Style.css文件添加了以下几行代码实现的。

知更鸟主题给评论头像添加旋转变圆特效知更鸟主题给评论头像添加旋转变圆特效

第一步,首先在Style.css中添加以下代码

  1. /**头像旋转的效果**/
  2. .avatar{
  3.    -webkit-transition:0.4s;
  4.    -webkit-transition:-webkit-transform 0.4s ease-out;
  5.    transition:transform 0.4s ease-out;
  6.    -moz-transition:-moz-transform 0.4s ease-out;
  7. }
  8. .avatar:hover{
  9.    transform:rotateZ(360deg);
  10.    -webkit-transform:rotateZ(360deg);
  11.    -moz-transform:rotateZ(360deg);
  12. }

第二步,在Style.css中查找以下代码并用新代码直接覆盖。

旧代码:

  1. .vcard .avatar {
  2.     float: left;
  3.     width: 64px;
  4.     height: 64px;
  5.     margin: 7px 10px 0 0;
  6.     padding: 3px;
  7.     border-radius: 5px;
  8.     border: 1px solid #ddd;
  9.     transition: all 0.8s ease 0s;
  10. }

用以下新代码直接替换。

  1. .vcard .avatar {
  2.     box-shadow:0px 0px 1px;
  3.     float: left;
  4.     width: 40px;
  5.     height: 40px;
  6.     margin: 6px 10px 0 0;
  7.     padding: 2px;
  8.     border: 1px solid #ddd;
  9.     transition: all 0.8s ease 0s;
  10.     -webkit-transition: all 0.8s ease 0s;
  11.     -moz-transition: all 0.8s ease 0s;
  12.     -o-transition: all 0.8s ease 0s;
  13.     -ms-transition: 0.8s;
  14. }
  15. .vcard:hover .avatar {
  16.     box-shadow:0px 0px 10px #0c0;
  17.     transform: rotate(720deg);
  18.     -webkit-transform: rotate(720deg);
  19.     -moz-transform: rotate(720deg);
  20.     -o-transform: rotate(720deg);
  21.     -ms-transform: rotate(720deg);
  22.     border-radius:40px!important;
  23.     filter:alpha(opacity=100)!important;
  24.     opacity:1!important;
  25. }

企鹅SEO
  • 本文由 发表于 2019年4月28日 14:59:53
  • 转载请务必保留本文链接:https://www.qieseo.com/21830.html
评论  3  访客  2  作者  1
    • 弥雅
      弥雅 2

      弥雅博客启用了新域名,麻烦顺便把友链那我博客的链接和名称更换一下吧!
      名称:弥雅博客
      链接:https://www.miyaboke.com

        • 企鹅博客
          企鹅博客

          @ 弥雅 好的

        • 大爷快来玩
          大爷快来玩 1

          现在不用写那么复杂了哇,

        发表评论