您的位置:首页 > Web前端 > CSS

【HTML】radio和checkbox样式美化

2016-07-08 17:37 926 查看
仅提供记录,怕忘记了

效果图:




<span style="font-size:14px;"><span class="radio-span">
<input type="radio" name="" value="0" checked="checked" class="radioClass"/>
</span>

<div class="check-custom">
  <input class="radioClass" type="checkbox" name="integral" value="1"/>
</div>

样式
.radio-span {
    width: 24px;
    height: 18px;
    padding-top: 3px;
    cursor: pointer;;
    text-align: center;
    margin-right: 10px;
    background-image: url(../image/inputradio.gif);
    background-repeat: no-repeat;
    background-position: -24px 0;
    display: inline-block;
    vertical-align: middle;
}
.radio-span > input {
    display: inline-block;
}
.on {
    background-position: 0 0;
}
.radioClass {
    opacity: 0;
    cursor: pointer;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
}

.check-custom {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-left: 10px;
    text-align: center;
    background-image: url(../image/checkbox_01.gif);
    background-repeat: no-repeat;
    background-position: 0 0;
    display: inline-block;
    margin-right: 5px;
}

.check-on {
    background-position: 0 -21px;
}
</span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  checkbox radio 美化 样式