html 绘制checkbox,css 绘制checkbox,radio

如何用css绘制checkbox,radio等

复选框效果

form{border: 1px solid #ccc;padding: 20px;width: 300px;margin: 30px auto;}

.wrapper{margin-bottom: 10px;}

.box{display: inline-block;position: relative;width: 20px;height: 20px;border: 2px solid orange;}

.box input{position: absolute;top: 0;left: 0;top: -3px;left: -4px;width: 21px;height: 21px; opacity: 0;cursor: pointer;z-index: 5; }

.box span{position: absolute;top: 1px; right: 6px;font-size: 19px;font-weight: bold;font-family: Arial; -webkit-transform: rotate(18deg); -moz-transform: rotate(18deg); -ms-transform: rotate(18deg); -o-transform: rotate(18deg); transform: rotate(18deg);color: orange;}

input[type="checkbox"]+span{opacity: 0;}

input[type="checkbox"]:checked+span{opacity: 1;}

我是选中状态

我是未选中状态

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值