弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 2601|回复: 0

【CSS】纯CSS3炫酷元素边框线条动画特效

[复制链接]
发表于 2017-11-5 09:59:51 | 显示全部楼层 |阅读模式
游客,如果您要查看本帖隐藏内容请回复

DIV:
<div class="bb"></div>
CSS:
.bb, .bb::before, .bb::after {
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          right: 0;
        }
         
        .bb {
          width: 200px;
          height: 200px;
          margin: auto;
          background: url("img/Button-White-Large.png") no-repeat 50%/70% rgba(0, 0, 0, 0.1);
          color: #69ca62;
          box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5);
        }
        .bb::before, .bb::after {
          content: '';
          z-index: -1;
          margin: -5%;
          box-shadow: inset 0 0 0 2px;
          animation: clipMe 8s linear infinite;
        }
        .bb::before {
          animation-delay: -4s;
        }
        .bb:hover::after, .bb:hover::before {
          background-color: rgba(255, 0, 0, 0.3);
        }
         
        @keyframes clipMe {
          0%, 100% {
            clip: rect(0px, 220.0px, 2px, 0px);
          }
          25% {
            clip: rect(0px, 2px, 220.0px, 0px);
          }
          50% {
            clip: rect(218.0px, 220.0px, 220.0px, 0px);
          }
          75% {
            clip: rect(0px, 220.0px, 220.0px, 218.0px);
          }
        }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-25 16:52 , Processed in 0.075668 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表