使用css修改radio、checkbox样式

  1. input[type=radio],input[type=checkbox]  {  
  2.     display: inline-block;  
  3.     vertical-align: middle;  
  4.     width: 20px;  
  5.     height: 20px;  
  6.     margin-left: 5px;  
  7.     -webkit-appearance: none;  
  8.     background-color: transparent;  
  9.     border: 0;  
  10.     outline: !important;  
  11.     line-height: 20px;  
  12.     color: #d8d8d8;  
  13. }  
  14. input[type=radio]:after  {  
  15.     content: "";  
  16.     display:block;  
  17.     width: 20px;  
  18.     height: 20px;  
  19.     border-radius: 50%;  
  20.     text-align: center;  
  21.     line-height: 14px;  
  22.     font-size: 16px;  
  23.     color: #fff;  
  24.     border: 2px solid #ddd;  
  25.     background-color: #fff;  
  26.     box-sizing:border-box;  
  27. }  
  28.   
  29. input[type=checkbox]:after  {  
  30.     content: "";  
  31.     display:block;  
  32.     width: 20px;  
  33.     height: 20px;  
  34.     text-align: center;  
  35.     line-height: 14px;  
  36.     font-size: 16px;  
  37.     color: #fff;  
  38.     border: 2px solid #ddd;  
  39.     background-color: #fff;  
  40.     box-sizing:border-box;  
  41. }  
  42. input[type=checkbox]:checked:after  {  
  43.     border: 4px solid #ddd;  
  44.     background-color: #37AF6E;  
  45. }  
  46.   
  47. input[type=radio]:checked:after  {  
  48.     content: "L";  
  49.     transform:matrix(-0.766044,-0.642788,-0.642788,0.766044,0,0);  
  50.     -webkit-transform:matrix(-0.766044,-0.642788,-0.642788,0.766044,0,0);  
  51.     border-color: #37AF6E;  
  52.     background-color: #37AF6E;  
  53. }   

转载于:https://www.cnblogs.com/da-yao/p/8080378.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值