css按钮悬停光影画效果

css 按钮悬停光影画效果

css 按钮悬停光影画效果

HTML 代码:

<a href="#">Button</a>

CSS 代码:

body {
     background: #b9ecc5;
      font-family: lato;
}

a {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #23252f;
    text-decoration: none;
    padding: 20px 45px;
    border-radius: 9px;
    background: #64ed85;
    box-shadow: 3px 3px 6px #296137, -3px -3px 6px #9fffd3;
    transition: all .3s;
    /* shine effect */
    background-repeat: no-repeat;
    background-position: -135px -135px, 0 0;
    background-image: -webkit-linear-gradient( top left, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.2) 37%, rgba(255, 255, 255, 0.8) 45%, rgba(255, 255, 255, 0.0) 50%);
    background-size: 250% 250%, 100% 100%;
    transition: background-position 0s ease;
}

a:active {
    border-radius: 25px;
    border-radius: 9px;
    background: #64ed85;
    box-shadow: inset 3px 3px 6px #296137, inset -3px -3px 6px #9fffd3;
}

a:hover {
    transform: translate(-50%, -50%) scale(1.03);
    background-position: 0 0, 0 0;
    transition-duration: 0.9s;
}

「点点赞赏,手留余香」

2

给作者打赏,鼓励TA抓紧创作!

微信微信 支付宝支付宝

还没有人赞赏,快来当第一个赞赏的人吧!

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
码云笔记 » css按钮悬停光影画效果

发表回复