修改 input[type=checkbox] 默认样式
2017-07-04 21:36
555 查看
html
<input type="checkbox">
css
input[type="checkbox"]{
position: relative;
}
input[type="checkbox"]:before{
position: absolute;
content: " ";
width:24px;
height: 24px;
border-radius:50%;
border:1px solid #dedede;
top:-7px;
left:-7px;
background-color: #fff;
}
input[type="checkbox"]:checked:after{
position: absolute;
content: "";
width:15px;
height: 15px;
border-radius:50%;
background-color: red;
top:-2px;
left:-2px;
}
html
<a href="javascript:;" class="input-file">选择文件
<input type="file" name="" id="">
</a>
css
.input-file {
position: relative;
display: inline-block;
background: #f60;
border: 1px solid #f50;
border-radius: 2px;
overflow: hidden;
color: #fff;
font-size:20px;
text-decoration: none;
line-height: 20px;
text-align:center;
}
.input-file input[type=file] {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity:0;
}
.input-file:hover {
background: #f50;
border-color: #f50;
color: #fff;
text-decoration: none;
}
<input type="checkbox">
css
input[type="checkbox"]{
position: relative;
}
input[type="checkbox"]:before{
position: absolute;
content: " ";
width:24px;
height: 24px;
border-radius:50%;
border:1px solid #dedede;
top:-7px;
left:-7px;
background-color: #fff;
}
input[type="checkbox"]:checked:after{
position: absolute;
content: "";
width:15px;
height: 15px;
border-radius:50%;
background-color: red;
top:-2px;
left:-2px;
}
html
<a href="javascript:;" class="input-file">选择文件
<input type="file" name="" id="">
</a>
css
.input-file {
position: relative;
display: inline-block;
background: #f60;
border: 1px solid #f50;
border-radius: 2px;
overflow: hidden;
color: #fff;
font-size:20px;
text-decoration: none;
line-height: 20px;
text-align:center;
}
.input-file input[type=file] {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity:0;
}
.input-file:hover {
background: #f50;
border-color: #f50;
color: #fff;
text-decoration: none;
}
相关文章推荐
- 用css修改input[type=checkbox]时默认样式
- input[type="date"]默认样式修改
- 修改input type=file 标签默认样式的简单方法
- input[type="date"]默认样式修改
- 如何修改input[type="file"]的默认样式
- input type="file"在各个浏览器下的默认样式,以及修改自定义样式
- input[type=date]默认样式修改
- CSS修改input[type=range]滑块样式
- 上传文件控制input type="file"样式修改记
- CSS3 去除苹果浏览器按钮input[type="submit"]和input[type="reset"]的默认样式
- 修改input file文件上传的默认样式 兼容ie8
- 修改radio、checkbox、select默认样式的方法
- HTML复选框checkbox默认样式修改
- 修改 input[type="file"] 原生样式
- 关于<input type="button" value="搜索">默认样式的清除
- 利用css3修改input[type=radio]样式
- css:默认的checkbox、input、radio太丑了?手把手教你改变使用纯css3改写的带动画的默认样式
- 修改radio、checkbox、select默认样式的方法
- js修改input的type属性问题(兼容所有浏览器,主要用于密码类的默认有提示文字的效果)
- 去掉或者修改 input、select 等表单的【默认样式 】