checkbox和radio元素的样式设置(简易版)
html代码
//html
<div>
<p style="font-size:18px;margin-top:30px;color:rgba(0,0,0,0.44)">约吗?</p>
<label class="demo--label">
<input class="demo--radio" type="radio" name="demo-radio">
<span class="demo--radioInput"></span>约
</label>
<label class="demo--label">
<input class="demo--radio" type="radio" name="demo-radio">
<span class="demo--radioInput"></span>不约
</label>
</div>
<div>
<p style="font-size:18px;margin-top:30px;color:rgba(0,0,0,0.44)">我帅不帅?</p>
<label class="demo--label"><input class="demo--radio" type="checkbox" name="demo-checkbox1">
<span class="demo--checkbox demo--radioInput"></span>帅
</label>
<label class="demo--label">
<input class="demo--radio" type="checkbox" name="demo-checkbox2">
<span class="demo--checkbox demo--radioInput"></span>很帅
</label>
<label class="demo--label">
<input class="demo--radio" type="checkbox" name="demo-checkbox3">
<span class="demo--checkbox demo--radioInput"></span>超级帅
</label>
</div>
css代码(网页)
//css(网页)
.demo--label{margin:20px 20px 0 0;display:inline-block}
.demo--radio{display:none}
.demo--radioInput{background-color:#fff;border:1px solid rgba(0,0,0,0.15);border-radius:100%;display:inline-block;width:16px;height:16px;margin-right:10px;margin-top:-1px;vertical-align:middle;line-height:1}
.demo--radio:checked + .demo--radioInput:after{background-color:#57ad68;border-radius:100%;content:"";display:inline-block;width:12px;height:12px;margin:2px;}
.demo--checkbox.demo--radioInput,.demo--radio:checked + .demo--checkbox.demo--radioInput:after{border-radius:0}
css代码(手机)
//css(手机)
.demo--label{display:inline-block;font-size: pRem(22)}
.demo--radio{display:none}
.demo--radioInput{background-color:#fff;border:1px solid rgba(0,0,0,0.15);border-radius:100%;display:inline-block;width:pRem(20);height:pRem(20);margin-right:pRem(4);margin-top:-2px;vertical-align:middle;line-height:1;position: relative;}
.demo--radio:checked + .demo--radioInput:after{background-color:#57ad68;border-radius:100%;content:"";display:inline-block;width:pRem(16);height:pRem(16);position: absolute;top: pRem(2);left: pRem(2);}
.demo--checkbox.demo--radioInput,.demo--radio:checked + .demo--checkbox.demo--radioInput:after{border-radius:0}
checkbox和radio元素的样式设置(简易版)的更多相关文章
- css hover对其包含的元素进行样式设置
<ul class="icon-down-single-arr-li"> <li> <a href="javascript:void(0)& ...
- css hover对其包括的元素进行样式设置
<ul class="icon-down-single-arr-li"> <li> <a href="javascript:void(0)& ...
- 自定义表单样式之checkbox和radio
1,起因 最近在工作中要实现自定义式的radio样式,而我们通常使用的时默认的样式,因为自己实在想不到解决的方法,于是开始搜索,最终看到了不错的解决办法,可以完美解决我们遇到的问题. 2,原理 大家都 ...
- 论checkbox和radio的样式美化问题
如果你下定决心要改变现有的默认的checkbox和radio的样式,那么我目前有两种办法: 1.自己动手写一个,也就是自己写代码实现将input的checkbox和radio默认的样式隐藏掉,使用绝对 ...
- checkbox和radio的样式美化问题
如果你下定决心要改变现有的默认的checkbox和radio的样式,那么我目前有两种办法: 1.自己动手写一个,也就是自己写代码实现将input的checkbox和radio默认的样式隐藏掉,使用绝对 ...
- 利用纯CSS美化checkbox和radio和滑动按钮的实现
W3C提供的CheckBox和radio的原始样式非常的丑,而且在不同的额浏览器表现还不一样,使用常规的方法添加样式没法进行修改样式 一, 单选按钮 <html> <head> ...
- checkbox、radio设置自定义样式
老生常谈,做一个简单的记录.浏览器自带的checkbox和radio样式可能不符合项目要求,通常要做一些自定义样式设置,目前基本的解决思路都是将input[type=checkbox/radio]隐藏 ...
- 巧用CSS3伪类选择器自定义checkbox和radio的样式
由于原生的checkbox和radio的样式太简陋了,在设计页面的时候,设计师往往会设计自己的checkbox和radio样式.一半情况下,为了适应各个浏览器的兼容性,我们都会用其他的元素替代原生的c ...
- css自定义checkbox和radio样式
很常见的问题,也有许多人写过类似的文章,自己写来记录下 css代码如下: #myCheck + label,.myRadio + label{ width:16px; height:16px; bor ...
随机推荐
- Vue 组件&组件之间的通信 之 单向数据流
单向数据流:父组件值的更新,会影响到子组件,反之则不行: 修改子组件的值: 局部数据:在子组件中定义新的数据,将父组件传过来的值赋值给新定义的数据,之后操作这个新数据: 如果对数据进行简单的操作,可以 ...
- SAP基本计量单位更改(转载)
转载自:http://blog.csdn.net/sapmatinal/article/details/50997819 在SAP中物料创建后,一旦发生业务,其基本计量单位便很难修改.由于单位无法满足 ...
- day 05
今天学习了数据类型的操作 首先需要知道 数据类型有哪些 1.数字类型 2.字符串类型 3.布尔类型 4.列表类型 5.字典类型 6.元组类型 7.集合类型类型 1.1数字类型里面有分 为整型(int) ...
- NABCD原则
1.我们的产品 <随堂小测APP> 是为了解决 <老师们> 的痛苦, 2-N.他们需要 随时组织课堂测验, 但是现有的方案并没有很好地解决这些需求,3-A.我们有独特的办法 ...
- 【Django模板进阶007】
本节主要讲 Django模板中的循环,条件判断,常用的标签,过滤器的使用 列表,字典,类的实例的使用 循环:迭代显示列表,字典等中的内容 条件判断:判断是否显示该内容,比如判断是手机访问,还是电脑访问 ...
- vs编译过程中出的错
如果运行时出现这样的错,关闭正在运行的.exe文件,即可正常运行
- 殊途同归 - Church-Rosser and Consistency of Evaluation
在"解释语言的语言"中提到,设计一个新的语言,仅仅是使用meta-language给出其描述是不够的,我们还需要去验证一些性质. 考虑一下我们在"解释语言 ...
- enum & json 之间的转换
enum 转为 string:EnumMember & StringEnumConverter public enum CampaignStatus : Int32 { [EnumMember ...
- Cent OS & Windows 双系统自定义引导菜单
系统环境 系统:Windows 10 (64-bit) & Cent OS 7 (64-bit) 引导程序:Grub2 编辑 grub.cfg 为了方便,在终端使用命令 su 输入密码进入超级 ...
- vi编程技巧:
h #向上j #向左k #向右l #向下a #插入o #插入一行,并在行首开始O #在当前行前插入一行,并在行首开始dd #删除当前行x #删除当前字符yy #复制当前行p #在当前行后面粘贴P #在 ...