CSS+checkbox 实现多选按钮 多选标签

效果图:

       CSS+checkbox 实现多选按钮 多选标签_第1张图片

CSS:

input[type="checkbox"] {
        position: absolute;
        clip: rect(0, 0, 0, 0);
    }

    input[type='checkbox'] + label {
        display: block;
        height: 30px;
        padding: 6px 12px;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.428571429;
        /*color: #009aff;*/
        border: 1px solid #ccc;
        text-align: center;
        float: left;
        margin-right: 10px;
        cursor: pointer;
        border-radius: 2px;
    }

     input[type='checkbox']:checked + label {
        /*border: 1px solid #009aff;*/
         background-color: #4dc63c;
         color: #fff;
         border-radius: 2px;
         font-weight: 500;
    }

jsp:

 
       
       
   

说明:

${serve}是后台返回的对象集合

你可能感兴趣的:(css)