如何使用伪元素扩大按钮可点击区域

话不多说直接上代码

效果

html代码

<button class="btn">Button</button>

css代码

.btn {
    position: relative;
    margin-left: 100px;
    cursor: pointer;
}
.btn:after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    bottom: -20px;
    left: -20px;
}

 

posted @ 2016-12-10 22:34  liangliang74  阅读(552)  评论(0编辑  收藏  举报