input radio单选框样式优化
HTML代码:
<form>
<div>
<input id="item1" type="radio" name="item" value="水果" checked>
<label for="item1"></label>
<span style="margin-left: 10px">水果</span>
</div>
<div>
<input id="item2" type="radio" name="item" value="饮料">
<label for="item2"></label>
<span style="margin-left: 10px">饮料</span>
</div>
</form>
css代码:
div {
position: relative;
line-height: 30px;
} input[type="radio"] {
width: 20px;
height: 20px;
opacity:;
} label {
position: absolute;
left: 5px;
top: 8px;
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #999;
} /*设置选中的input的样式*/
/* + 是兄弟选择器,获取选中后的label元素*/
input:checked+label {
background-color: #006eb2;
border: 1px solid #006eb2;
} input:checked+label::after {
position: absolute;
content: "";
width: 5px;
height: 10px;
top: 3px;
left: 6px;
border: 2px solid #fff;
border-top: none;
border-left: none;
transform: rotate(45deg)
}
效果图:
input radio单选框样式优化的更多相关文章
- jquery 操作input radio 单选框
1.jquery选中单选框 2.jquery 取消单选框 3.判断是否选中 4.设置不可编辑
- input radio单选框绑定change事件
html页面: <input type="radio" name="sex" value="female">female < ...
- jquery--获取input radio单选框的值
html <input type="radio" name="sex" value="man" checked> man < ...
- 利用CSS 修改input=radio的默认样式(改成选择框)
html部分: <input id="item2" type="radio" name="item"> <label fo ...
- 前端 HTML form表单标签 input标签 type属性 radio 单选框
<input type="radio"> 单选框 适用于 选择性别按钮网页等 <!DOCTYPE html> <html lang="en& ...
- 用css实现html中单选框样式改变
我们都知道,input的单选框是一个小圆框,不能直接更改样式.但是我们在很多网页中看到的单选框样式可不仅限于默认的那个样式(看上去没啥新意,也比较丑).那么,接下来我将介绍下如何实现该功能. 首先, ...
- TagHelper+Layui封装组件之Radio单选框
TagHelper+Layui封装组件之Radio单选框 标签名称:cl-radio 标签属性: asp-for:绑定的字段,必须指定 asp-items:绑定单选项 类型为:IEnumerable& ...
- 纯css3简单实用的checkbox复选框和radio单选框
昨天为大家分享了一款很炫的checkbox复选框和radio单选框,今天再给大家带来一款简单实用的checkbox复选框和radio单选框.界面清淅.舒服.先给大家来张效果图: 在线预览 源码下载 ...
- 纯css3实现的超炫checkbox复选框和radio单选框
之前为大家分享了好多css3实现的按钮.今天要为大家分享的是纯css3实现的checkbox复选框和radio单选框,效果超级炫.先让我们看看图吧! 在线预览 源码下载 这个实例完全由css3实现 ...
随机推荐
- Python数据结构:栈 队列
栈,队列的特性: 1.栈(stacks)是一种只能通过访问其一端来实现数据存储与检索的线性数据结构,具有后进先出(last in first out,LIFO)的特征 2.队列(queue)是一种具有 ...
- Winform 多线程--解决界面卡死问题
public class ThreadInvoker { /// <summary> /// 回调委托 带参数的 /// </summary> /// <param na ...
- JavaScript -- Window-Focus
-----034-Window-Focus.html----- <!DOCTYPE html> <html> <head> <meta http-equiv= ...
- 配置Zookeper
在整个的codis架构之中,codis-proxy将作为所有的codis-server的对外的代理,而在整个的处理之中,codis-proxy所保存的数据一定是所有的codis-server的信息,那 ...
- jdk8-lambda表达式的使用
1, 遍历list集合 List<Integer> list = new ArrayList<>(); list.add(1); list.add(2); list.add(3 ...
- 解决 https 证书验证不通过的问题
解决的办法:忽略服务端和客户端的证书校验即可.java 提供的相关的类. 通过重写TrustManager的checkClientTrusted(检查客户端证书信任)和checkServerTrust ...
- mysql 导出 sql的执行结果到 csv文件
需求: 1. 执行某 SQL 的结果: 2. 将结果导出到 csv文件: 3. 通过命令行执行: mysql ;" | sed 's/\t/","/g;s/^/" ...
- JDK7与JDK8中HashMap的实现
JDK7中的HashMap HashMap底层维护一个数组,数组中的每一项都是一个Entry transient Entry<K,V>[] table; 我们向 HashMap 中所放置的 ...
- docker-部署elk-6.1.3
1.更新daocker版本 2.pull官方的镜像 https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docker.html ht ...
- 导入maven项目遇到中文乱码
windows->preferences->content types->word Document 并输入utf-8->update; 右键选中的项目,选择propertie ...