欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

按钮—按钮点击特效

程序员文章站 2022-06-09 17:01:57
...

按钮—按钮点击特效

按钮—按钮点击特效

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点击特效</title>
    <style>
        div#btn {
            position: fixed;
            top : 200px;
            left: 200px;
            width: 70px;
            height: 20px;
            border: 1px solid #262626;
            border-radius: 5px;

            text-align: center;
            user-select: none;
        }

        div#btn:hover {
            background-color: #262626;
            color: #fff;
        }

        div#btn::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            width: 100%;
            height: 100%;
            background: transparent;
            border: 1px solid #262626;
            border-radius: 5px;
            border-radius: 5px;

        }
        div#btn:hover::before {
            transform: scale(1.2, 1.4);
            opacity: 0;
            transition: .8s;

        }
    </style>
</head>
<body>
    <div id='btn'>
        Button
    </div>
</body>
</html>