posts - 609,  comments - 13,  views - 64万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
出来是彩色的 radio button
复制代码
.rdo_enabled {
    vertical-align: middle;
    margin-top: 5px;
    font-size: 25px;
    transform: scale(2);
    line-height: 60px;
    background-color: #1890ff;
}

.rdo_disabled {
    vertical-align: middle;
    margin-top: 5px;
    font-size: 25px;
    transform: scale(2);
    line-height: 60px;
    background-color: rebeccapurple;
}

.loc input[type="radio"] + label::before {
    content: " ";
    display: inline-block;
    vertical-align: middle;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: .064rem solid #1890ff;
    margin-right: .213333rem;
    box-sizing: border-box;
}

.loc input[type="radio"]:checked + label::before {
    background-color: #1890ff;
    background-clip: content-box;
    padding: .149333rem;
    box-sizing: border-box;
}


.loc input[type="radio"]:disabled + label::before {
    background-color: #d9d9d9;
    background-clip: content-box;
    padding: .149333rem;
    box-sizing: border-box;
    border: .064rem solid #d9d9d9;
}

.loc input[type="radio"] {
    position: absolute;
    clip: rect(0, 0, 0, 0);
}
复制代码

html

<span class="loc">
    <input type="radio" class="rdo_enabled" disabled="disabled" id="rdoMan" name="gender" />
    <label for="rdoMan">男</label>

    <input type="radio" class="rdo_disabled" id="rdoWomen" name="gender" />
    <label for="rdoWomen">女</label>
</span>

 

posted on   邢帅杰  阅读(290)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
历史上的今天:
2020-09-07 蓝牙开发
点击右上角即可分享
微信分享提示