How to customize radio button in html

后端 未结 4 1476
轻奢々
轻奢々 2020-12-09 23:00

I am trying to get radio button like this..

\"enter

But I am getting like this

4条回答
  •  死守一世寂寞
    2020-12-09 23:40

    input[type=radio].css-checkbox {
        position: absolute;
        z-index: -1000;
        left: -1000px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        height: 1px;
        width: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
    }
    input[type=radio].css-checkbox + label.css-label {
        padding-left: 30px;
        height: 25px;
        display: inline-block;
        line-height: 25px;
        background-repeat: no-repeat;
        background-position: 0 0;
        font-size: 25px;
        vertical-align: middle;
        cursor: pointer;
    }
    input[type=radio].css-checkbox:checked + label.css-label {
        background-position: 0 -25px;
    }
    label.css-label {
        background-image: url(http://csscheckbox.com/checkboxes/u/csscheckbox_98809849d4d88f570f5ad4ce6c2be5b1.png);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    

    check out this fiddle.

提交回复
热议问题