代码:

<!doctype html>
<html> <head>
<meta charset="utf-8">
<title>选择框样式</title>
<style>
label {
font-size: 12px;
cursor: pointer;
} label i {
font-size: 12px;
font-style: normal;
display: inline-block;
width: 12px;
height: 12px;
text-align: center;
line-height: 12px;
color: #fff;
vertical-align: middle;
margin: -2px 2px 1px 0px;
border: #2489c5 1px solid;
} input[type="checkbox"],
input[type="radio"] {
display: none;
} input[type="radio"]+ i {
border-radius: 7px;
} input[type="checkbox"]:checked+ i,
input[type="radio"]:checked+ i {
background: #2489c5;
} input[type="checkbox"]:disabled+ i,
input[type="radio"]:disabled+ i {
border-color: #ccc;
} input[type="checkbox"]:checked:disabled+ i,
input[type="radio"]:checked:disabled+ i {
background: #ccc;
}
</style>
</head> <body>
<label><input type="checkbox"><i>✓</i>复选框</label><br>
<label><input type="checkbox" checked><i>✓</i>复选框</label><br>
<label><input type="checkbox" disabled><i>✓</i>复选框禁用</label><br>
<label><input type="checkbox" disabled checked><i>✓</i>复选框禁用已选</label><br>
<label><input type="radio" name="abc"><i>✓</i>单选框</label><br>
<label><input type="radio" name="abc" checked><i>✓</i>单选框</label><br>
<label><input type="radio" name="abc" disabled><i>✓</i>单选框禁用</label><br>
<label><input type="radio" name="def" disabled checked><i>✓</i>单选框禁用已选</label><br>
</body> </html>

效果:

重置 radio 和 checkbox 的样式的更多相关文章

  1. 微信小程序 - 更改radio和checkbox选中样式

    点击下载源码:示例-更改radio或checkbox选中样式

  2. 用纯css改变默认的radio和checkbox的样式

    利用css的label的伪类(::before)代替checkbox和radio效果: 优点:需要图片来调整选中前和选中后的样式,纯css搞定 缺点:兼容性,IE8以下不支持 在线例子: css改变默 ...

  3. 自定义radio、checkbox的样式

    input标签中的radio和checkbox是很表单中常用的类型,大多时候,默认样式并不能满足我们的需求,所以有了此篇. 自定义样式,由此开启: html: <div class=" ...

  4. CSS3 radio 或checkbox 自定义 样式

    .style-radio {position:relative;width:15px;height:15px;outline:none;} .style-radio:after {position:a ...

  5. 前端开发:css技巧,如何设置select、radio 、 checkbox 、file这些不可直接设置的样式 。

    前言: 都说程序员有三宝:人傻,钱多,死得早.博主身边的程序“猿”一大半应了这三宝,这从侧面说明了一个问题,只有理性是过不好日子的.朋友们应该把工作与生活分开,让生活变得感性,让工作变得理性,两者相提 ...

  6. 修改radio、checkbox、select默认样式的方法

    样式 radio select checkbox 兼容性 现在前端页面效果日益丰富,默认的input组件样式显然已经不能满足需求.趁着这次开发的页面中有这方面的需求,在这里整理一下修改radio.ch ...

  7. 微信小程序修改radio和checkbox的默认样式和图标

    wxml: <view class="body"> <view class="body-content"> 第1题:企业的价值观是 ? ...

  8. radio 和checkbox与文字对齐问题

    今天在项目中遇到radio和文字对齐问题(ie不明显,火狐和google比较明显),在此记录. 1.浏览器默认文字大小为14px,因而当文字字体为14px时radio和checkbox与文字对齐良好, ...

  9. 用纯CSS美化radio和checkbox

    Radio和checkbox需要美化吗?答案是必须的,因为设计风格一直都会变化,原生的样式百年不变肯定满足不了需求. 先看看纯CSS美化过后的radio和checkbox效果:查看. 项目地址:mag ...

随机推荐

  1. [CodeForces-797F]Mice and Holes

    题目大意: 在一条直线上,有n个老鼠,m个洞. 每个老鼠i都有一个初始位置x[i]. 每个洞i都有一个固定位置p[i]和容量限制c[i]. 求所有老鼠都进洞的最小距离总和. 思路: 动态规划. 用f[ ...

  2. python爬取基础网页图片

    python基础爬虫总结 1.爬取信息原理 与浏览器客户端类似,向网站的服务器发送一个请求,该请求一般是url,也就是网址.之后服务器响应一个html页面给客户端,当然也有其他数据类型的信息,这些就是 ...

  3. 51nod 1035 最长的循环节 数学

    1035 最长的循环节 题目连接: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1035 Description 正整 ...

  4. zoj 1610 Count the Colors 线段树区间更新/暴力

    Count the Colors Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/show ...

  5. Ubuntu 16.09下iptables通过raw表实现日志输出和调试

    1.先配置好raw表日志打点功能 参考:http://www.cnblogs.com/EasonJim/p/8413563.html 2.配置好messages文件 参考:http://www.cnb ...

  6. HDU 4704 Sum (2013多校10,1009题)

    Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submi ...

  7. windows系统上安装与使用Android NDK r8d(一)

    什么是NDK? NDK 提供了一系列的工具,帮助开发者快速开发C(或C++)的动态库,并能自动将so 和 java 应用一起打包成apk.这些工具对开发者的帮助是巨大的. NDK 集成了交叉编译器,并 ...

  8. source insight完全卸载

    由于不知名原因 source insight崩溃了,使用自带的卸载,完成之后重新安装软件注册还是出问题.在网上搜索资料发现就是删除注册表中的内容. 由于列出的删除项目不完全,导致还是出问题. 最后删除 ...

  9. Interactive Messager

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. Latex 语法总结——层次结构

    层次结构~~documentclass[a4paper,11pt]{article}\usepackage{CJKutf8}\usepackage[top=1in, bottom=1in, left= ...