热搜: fiddler git ip 代理
历史搜索

css按钮悬停光影画效果

游客2024-12-16 12:03:02

css 按钮悬停光影画效果

css按钮悬停光影画效果 1

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;
}