How do I remove checkbox border?

前端 未结 8 1217
别跟我提以往
别跟我提以往 2020-12-06 05:33

Is it possible to remove the borders around a checkbox so that it appears invisible? I have it placed in a DIV with a color background.

相关标签:
8条回答
  • 2020-12-06 06:17

    As this is the first result for me when searching for "remove checkbox border" in Google, let me mention that checkbox default styling could be removed in all browsers except IE with the appearance property:

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    0 讨论(0)
  • 2020-12-06 06:18
    input[type="checkbox"] {
        width: 25px;
        height: 25px;
        background: gray;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border: none;
        outline: none;
        position: relative;
        left: -5px;
        top: -5px;
        cursor: pointer;
    }
    
    0 讨论(0)
提交回复
热议问题