单选多选样式写法

Posted bonly-ge

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了单选多选样式写法相关的知识,希望对你有一定的参考价值。

动画多选样式

// html
<div id="box">
    <input type="checkbox" id="check" name="check" />
    <label for="check">Checkbox</label>
</div>

// css
input[type=checkbox]+label:before {
    height: 16px;
    line-height: 16px;
    width: 16px;
    border: 1px solid #000;
    display: inline-block;
    vertical-align: top;
    text-align: center;
    margin-right: 5px;
    content: "2713";
    color: transparent;
    transition: color ease .3s;
}
input[type=checkbox]:checked+label:before {
    color: #000;
}

单选按钮样式

// html
<div id="box">
    <input type="radio" id="check" name="check" />
    <label for="check">Checkbox</label>
</div>
// css
input[type=radio] {
    display: none;
}
input[type=radio]+label:before {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    vertical-align: top;
    margin-right: 20px;
    content: "26AB";
    border: 1px solid #000;
    border-radius: 50%;
    font-size: 0;
    transition: font-size ease .3s;
}
input[type=radio]:checked+label:before {
    font-size: 12px;
}

参考

掘金-22个必备的CSS小技巧

以上是关于单选多选样式写法的主要内容,如果未能解决你的问题,请参考以下文章

iOS——UITableView单选模式,多选模式,单选多选混合模式

Android实现选择题答题(包括单选多选和答题卡)

单选多选

vue单选多选,文本域,选择框

java 通用单选多选列表(RecyclerView)

IT小鲜肉 Widgets Tree 单选多选相关回调函数获取选中的节点功能