:after伪类的用法,checkbox,radio,content
2017-02-21 11:08
387 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.cross{
margin: 100px;
width: 40px;
height: 40px;
background-color: #F3F9FF;
border-radius: 20px;
border: 1px solid #DBE6EF;
display: inline-block;
position: relative;
position: relative;
}
.cross:after{
content: "\2715";//特殊字符或形状
color: #a2b6c5;
font-size: 40px;
position: absolute;
cursor: pointer;
top: -9px;
left: 4px;
}
.cross:hover::after{
content: "\2764";//特殊字符或形状
color: #a2b6c5;
font-size: 40px;
position: absolute;
cursor: pointer;
top: -7px;
left: 1px;
}
input[type=checkbox],input[type=radio]{
display: inline-block;
width: 28px;
height: 28px;
border: 0;
outline: 0!important;
background-color: transparent;
-webkit-appearance: none;
position: relative;
}
input[type=checkbox]:before,input[type=radio]:before {
content: "";
background: url(imgs/icon02.png);
display: inline-block;
/*background: palegreen;
border-radius: 50%;*/
position: absolute;
width: 48px;
height: 48px;
}
input[type=checkbox]:checked:before,input[type=radio]:checked:before {
content: "";
background: url(imgs/icon01.png);
display: inline-block;
/* background: palegreen; */
/* border-radius: 50%; */
position: absolute;
width: 48px;
height: 48px;
}
</style>
</head>
<body>
<div id="div1" style="margin: 200px;">
<div id="" class="cross"></div>
<input type="checkbox" name="checkbox01" id="" value="" />
<input type="checkbox" name="checkbox01" id="" value="" />
<br/>
<input type="radio" name="dongtao" id="" value="" />
<input type="radio" name="dongtao" id="" value="" />
</div>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.cross{
margin: 100px;
width: 40px;
height: 40px;
background-color: #F3F9FF;
border-radius: 20px;
border: 1px solid #DBE6EF;
display: inline-block;
position: relative;
position: relative;
}
.cross:after{
content: "\2715";//特殊字符或形状
color: #a2b6c5;
font-size: 40px;
position: absolute;
cursor: pointer;
top: -9px;
left: 4px;
}
.cross:hover::after{
content: "\2764";//特殊字符或形状
color: #a2b6c5;
font-size: 40px;
position: absolute;
cursor: pointer;
top: -7px;
left: 1px;
}
input[type=checkbox],input[type=radio]{
display: inline-block;
width: 28px;
height: 28px;
border: 0;
outline: 0!important;
background-color: transparent;
-webkit-appearance: none;
position: relative;
}
input[type=checkbox]:before,input[type=radio]:before {
content: "";
background: url(imgs/icon02.png);
display: inline-block;
/*background: palegreen;
border-radius: 50%;*/
position: absolute;
width: 48px;
height: 48px;
}
input[type=checkbox]:checked:before,input[type=radio]:checked:before {
content: "";
background: url(imgs/icon01.png);
display: inline-block;
/* background: palegreen; */
/* border-radius: 50%; */
position: absolute;
width: 48px;
height: 48px;
}
</style>
</head>
<body>
<div id="div1" style="margin: 200px;">
<div id="" class="cross"></div>
<input type="checkbox" name="checkbox01" id="" value="" />
<input type="checkbox" name="checkbox01" id="" value="" />
<br/>
<input type="radio" name="dongtao" id="" value="" />
<input type="radio" name="dongtao" id="" value="" />
</div>
</body>
</html>
相关文章推荐
- s:radio与s:checkboxlist用法
- s:radio标签或者s:checkbox标签用法
- 转载:after伪类的用法
- CSS伪类对象before和after的用法实例详解
- css中伪类:after的用法(三种方式)
- jquery的checkbox,radio,select常用用法
- css3使用checked伪类隐藏传统的radio和checkbox
- CSS 属性 :before && :after的用法,伪类和伪元素的区别
- 借Vue-iview样式修改,熟悉:before和:after伪类的用法
- radio和checkBox的用法:
- 安卓初学:Radio单选框和checkBox多选控件的主要用法以及事件绑定总结
- 01-12:RadioGroup、RadioButton、CheckBox、Toast的用法
- 伪类选择器:checked将作用与input类型为radio或者checkbox以及option
- Radio和checkbox用法
- CSS中伪类:after的用法
- Silverlight控件用法合集DataGrid,ComboBox,DataPick,CheckBox,RadioButtonSilverlight控件用法合集DataGrid,ComboBox,DataPick,CheckBox,RadioButton
- [DIV/CSS] CSS 属性 :before && :after的用法,伪类和伪元素的区别
- angular 表单元素,例如checkbox,radio,select等用法
- 【幻化万千戏红尘】qianfeng-Android-Day03-RadioButton及RadioGroup的用法、CheckBox、ProgressBar基础学习:
- HtmlHelper用法大全3:编辑用户信息(Html.LabelFor、Html.EditorFor、Html.RadioButtonFor、Html.CheckBoxFor)