Html
    Css
    Js

    
                        
.box {
        position: relative;
        margin: 0 auto;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        border: 1px solid rgba(235, 235, 235, .3);
        overflow: hidden;
      }
      .box:after {
        content: '';
        width: 160px;
        height: 160px;
        border-radius: 50%;
        background: rgb(255, 255, 255);
        transition: .3s all linear;
        opacity: 0;
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        transform: scale(0);
        margin: auto;
        background: url(http://www.jq22.com/demo/jQueryHover201706082104/img/2.png) no-repeat center 0px / cover;
      }
      .fb {
        position: absolute;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        opacity: .4;
        transition: .3s all ease-in;
      }
      .fb:nth-child(1) {
        background: rgba(255, 0, 0, 1);
        transform: translateX(0)translateY(-100px);
      }
      .fb:nth-child(2) {
        background: rgba(255, 165, 0, 1);
        transform: translateX(70.7px)translateY(-70.7px);
      }
      .fb:nth-child(3) {
        background: rgba(255, 255, 0, 1);
        transform: translateX(100px)translateY(0);
      }
      .fb:nth-child(4) {
        background: rgba(0, 255, 0, 1);
        transform: translateX(70.7px)translateY(70.7px);
      }
      .fb:nth-child(5) {
        background: rgba(0, 127, 255, 1);
        transform: translateX(0)translateY(100px);
      }
      .fb:nth-child(6) {
        background: rgba(0, 0, 255, 1);
        transform: translateX(-70.7px)translateY(70.7px);
      }
      .fb:nth-child(7) {
        background: rgba(139, 0, 255, 1);
        transform: translateX(-100px)translateY(0);
      }
      .fb:nth-child(8) {
        background: rgba(255, 0, 0, 1);
        transform: translateX(-70.7px)translateY(-70.7px);
      }
      .box:hover::after {
        transform: scale(1);
        opacity: .7;
      }
      .box:hover .fb:nth-child(1) {
        background: rgba(255, 0, 0, 1);
        transform: translateX(0)translateY(-20px);
      }
      .box:hover .fb:nth-child(2) {
        background: rgba(255, 165, 0, 1);
        transform: translateX(-14.14px)translateY(14.14px);
      }
      .box:hover .fb:nth-child(3) {
        background: rgba(255, 255, 0, 1);
        transform: translateX(20px)translateY(0);
      }
      .box:hover .fb:nth-child(4) {
        background: rgba(0, 255, 0, 1);
        transform: translateX(14.14px)translateY(14.14px);
      }
      .box:hover .fb:nth-child(5) {
        background: rgba(0, 127, 255, 1);
        transform: translateX(0)translateY(20px);
      }
      .box:hover .fb:nth-child(6) {
        background: rgba(0, 0, 255, 1);
        transform: translateX(-14.14px)translateY(14.14px);
      }
      .box:hover .fb:nth-child(7) {
        background: rgba(139, 0, 255, 1);
        transform: translateX(-20px)translateY(0);
      }
      .box:hover .fb:nth-child(8) {
        background: rgba(255, 0, 0, 1);
        transform: translateX(-14.14px)translateY(-14.14px);
      }

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

css3头像显示

2
      bill0
      2017/6/19 12:32:54

      有种很奇怪的感觉,圆形和正方形的相互过度好像并不好看

          Supreme0
          2017/6/20 13:34:20

          你用的什么浏览器,ie 和qq好像有些不支持

      回复