美文网首页
CheckBox 复选框点击过快导致选中旁边文字问题

CheckBox 复选框点击过快导致选中旁边文字问题

作者: peterz博客 | 来源:发表于2018-08-31 21:44 被阅读6次

就是这个 ↓↓↓


20170407014318300.gif

感觉挺恶心的…于是解决方法就来了,操刀 CSS

.disabled-click-text {
    -moz-user-select: none; /* FireFox */
    -webkit-user-select: none; /* Webkit */
    -ms-user-select: none; /* IE10+ */
    -khtml-user-select: none; /* 奇葩浏览器 */
    user-select: none; /* 文本不允许被选择 */
}

HTML 部分

<div class="form-group">
    <!-- 加在下面的 div 里 -->
    <div class="col-xs-7 col-sm-8 disabled-click-text">
        <label class="css-input switch switch-sm switch-success">
            <input type="checkbox" id="register-terms" name="register-terms"> <span></span>我同意服务条款</label>
    </div>
</div>

然后就完美了,强迫症解除:


20170407015149007.gif

相关文章

网友评论

      本文标题:CheckBox 复选框点击过快导致选中旁边文字问题

      本文链接:https://www.haomeiwen.com/subject/nniewftx.html