Edit in JSRUN

console 命令行工具 X clear

                    
>
console
<div><a href="javascript:void(0)" class="btn">Hover me</a></div>
* {
            padding: 0;
            margin: 0;
        }

        body {
            font: 14px/1.5 Arial;
            box-sizing: border-box;
        }

        .btn {
            display: block;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-transform: uppercase;
            width: 200px;
            height: 40px;
            text-decoration: none;
            color: #fff;
            text-align: center;
            line-height: 40px;
            border: 1px solid #d91222;
            -moz-box-shadow: 200px 0 #d91222 inset; /*通过正负值调整变化方向*/
            box-shadow: 200px 0 #d91222 inset;
            -webkit-transition: all 0.3s;
            -moz-transition: all 0.3s;
            -o-transition: all 0.3s;
            transition: all 0.3s;
        }
        .btn:hover {
            box-shadow: 0 0 #d91222 inset;
            color: #d91222;
        }