html单选框样式复写,css重写单选框和复选框样式

008dcb06e224dce0e848a306f6d545a6.png

37171ce27df5ba16c963a725e42d35b8.png

7cfcb08086c0230dd3da90c90ee2392c.png

d9d5acac4e8d03338c8aea810a56bd24.png

bef2e66719c5dff1363a4c6f751a1d51.png

**************************第一种样式开始************************************/

css:

/*单选样式重写*/

input[type='radio'].radio {opacity:0;position: absolute;}

label.radio {cursor: pointer; font-size:14px;min-width:80px;display:block; -webkit-appearance: none;background-color:#FAFAFA;border:1px solid #CCCCCC;color: #333333;height:28px;line-height: 28px;margin: 5px; text-align: center;padding: 0 5px;}

input[type='radio'].radio:checked + .radio {background-color:#2095F2;border:1px solid #2095F2;color: #fff;}

/*多选样式重写*/

input[type='checkbox'].checkbox {opacity:0;position: absolute;}

label.checkbox {position: relative; cursor: pointer; font-size:14px;min-width:80px;display:block; -webkit-appearance: none;background-color:#FAFAFA;border:1px solid #CCCCCC;color: #333333;height:28px;

line-height: 28px;margin: 5px; text-align: center;padding: 0 35px 0 5px;}

input[type='checkbox'].checkbox:checked + .checkbox {background-color:#2095F2;border:1px solid #2095F2;color: #fff;}

label.checkbox:before{position: absolute; content: " ";right: 0;background:url(../img/i_check.png) center center;width: 28px;height: 28px;border-left: 1px solid #CCCCCC;background-size: 28px 28px;}

input[type='checkbox'].checkbox:checked + .checkbox:before {background:url(../img/i_checked.png) center center;border-left: 1px solid #2095F2;}

页面:

随访内容:

1、膳食原则遵守情况

2、选用的膳食处方(可多选)

处方A

处方B

处方C

处方D

其他

**************************第一种样式结束************************************/

**************************第二种样式开始************************************/

css:

/*复选样式重写*/

.table_style{display: inline-block;margin: 0px 10px;color: #666;}

.choicebox{display: inline-block;margin: 0px 10px;color: #666;}

input[type="checkbox"] {

-webkit-appearance: none;

background:url(../img/bg_icon.png) no-repeat;

height:18px;

vertical-align: middle;

width: 20px;

}

input[type="checkbox"]:checked {background-position: -20px 0;}

/*单选样式重写*/

input[type="radio"] {

-webkit-appearance: none;

background:url(../img/bg_icon.png) no-repeat;

height:18px;

vertical-align: middle;

width: 20px;

background-position: -154px -2px;

}

input[type="radio"]:checked {background-position: -130px -2px;}

/*页面*/

**************************第二种样式结束************************************/

几个风格好看的CSS3单选复选按钮美化样式,简单的表单单选框复选框美化代码。 <!DOCTYPE HTML> <html> <head> <title>好看的CSS3单选复选按钮美化样式</title> <link rel="stylesheet" type="text/css" href="css/style.css?3.1.64" /> </head> <body>[removed][removed] <div id="holder"> <div> <div class="tag">Checkbox Small</div> <input type="checkbox" id="checkbox-1-1" class="regular-checkbox" /><label for="checkbox-1-1"></label> <input type="checkbox" id="checkbox-1-2" class="regular-checkbox" /><label for="checkbox-1-2"></label> <input type="checkbox" id="checkbox-1-3" class="regular-checkbox" /><label for="checkbox-1-3"></label> <input type="checkbox" id="checkbox-1-4" class="regular-checkbox" /><label for="checkbox-1-4"></label> </div> <div> <div class="tag">Checkbox Big</div> <input type="checkbox" id="checkbox-2-1" class="regular-checkbox big-checkbox" /><label for="checkbox-2-1"></label> <input type="checkbox" id="checkbox-2-2" class="regular-checkbox big-checkbox" /><label for="checkbox-2-2"></label> <input type="checkbox" id="checkbox-2-3" class="regular-checkbox big-checkbox" /><label for="checkbox-2-3"></label> <input type="checkbox" id="checkbox-2-4" class="regular-checkbox big-checkbox" /><label for="checkbox-2-4"></label> </div> <div> <div class="tag">Radio Small</div> <div class="button-holder"> <input type="radio" id="radio-1-1" name="radio-1-set" class="regular-radio" checked /><label for="radio-1-1"></label><br /> <input type="radio" id="radio-1-2" name="radio-1-set" class="regular-radio" /><label for="radio-1-2"></label><br /> <input type="radio" id="radio-1-3" name="radio-1-set" class="regular-radio" /><label for="radio-1-3"></label><br /> <input type="radio" id="radio-1-4" name="radio-1-set" class="regular-radio" /><label for="radio-1-4"></label><br /> </div> </div> <div> <div class="tag">Radio Big</div> <div class="button-holder"> <input type="radio" id="radio-2-1" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-1"></label><br /> <input type="radio" id="radio-2-2" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-2"></label><br /> <input type="radio" id="radio-2-3" name="radio-2-set" class="regular-radio big-radio" checked /><label for="radio-2-3"></label><br /> <input type="radio" id="radio-2-4" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-4"></label><br /> <input type="radio" id="radio-2-5" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-5"></label><br /> </div> </div> </div> <div 0; font:normal 14px/24px 'MicroSoft YaHei';">  </div> </body> </html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值