HTML radio自定义美化样式。
来源:互联网 发布:淘宝美工一般要做什么 编辑:程序博客网 时间:2024/06/08 09:21
自己写了个radio样式,根据项目需求写的。上传到博客,方便以后使用。
先贴css样式,样式不多,比较简单,易懂。
.radio_btn{ width: 30px; height: 30px; background: url(../images/dx.png) no-repeat; background-size: cover; display: inline-block; /*background: orange;*/ border-radius:50%; position: relative; vertical-align: middle; } .radio_btn input{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0; z-index: 100; } .radio_btn span{ background: url(../images/dx-.png) no-repeat; background-size: cover; width: 100%; height: 100%; display: inline-block; position: absolute; top: 0; left: 0; z-index: 1; border-radius: 50%; } .radio_btn input[type=radio]+span{ opacity: 0; } .radio_btn input[type=radio]:checked+span{ opacity: 1; }
HTML部分:
<div class="radio_btn"> <input type="radio" name="sex" id="man" value="" checked="checked" /> <span></span> </div> <div class="radio_btn"> <input type="radio" name="sex" id="male" value="" /> <span></span> </div>
注意:图片是本地所有,可根据自己的需求来。可以定义成背景颜色来显示。
阅读全文
0 0
- HTML radio自定义美化样式。
- html radio样式美化
- 【HTML】radio和checkbox样式美化
- html自定义radio checkbox样式
- 自定义 checkbox, radio 样式
- 自定义radio单选组样式
- 纯CSS 实现radio checkbox样式美化
- 纯css3美化checkbox、radio默认样式
- css input checkbox和radio样式美化
- html修改radio、checkbox样式
- 自定义checkbox和radio样式
- 实现自定义checkbox、radio样式
- input的checkbox和radio控件样式美化
- IFE糯米学院-checkbox和radio样式的美化实现
- css input[type=file] 样式美化 (radio checkbox类似)
- 纯CSS美化input radio和checkbox的样式
- html+css3实现自定义radio
- html 美化滚动条默认样式
- java序列化
- struts2_day03_12_从值栈获取list集合(两种方式)_13_从值栈获取list集合(第三种方式)
- 关于测试的思考
- 统计学习导论 Chapter8 -- Tree-Based Methods
- FCN(全卷积神经网络)+CRF+分割图
- HTML radio自定义美化样式。
- Las.css
- Greenplum 列存表(AO表)的膨胀、垃圾检查与空间收缩
- Openstack 多后端配置--详解NFS作为Cinder的后端存储
- java.util.Concurrent.BlockingQueue
- nginx 中 index try_files location 这三个配置项的作用
- Codeforces Round #448 (Div. 2) 895A. Pizza Separation
- dubbo 框架
- mysql group_concat用法