码迷,mamicode.com
首页 > 其他好文 > 详细

表单单选按钮美化

时间:2016-10-17 11:29:07      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>单选按钮美化</title>
<style>
label{
position:relative;
display:inline-block;
cursor:pointer;
}
label>input{
display:none;
}
label .radio-inner{
position:relative;
padding-left:35px;
}
label .radio-inner:before{
content:‘‘;
position:absolute;
width:20px;
height:20px;
top:0;
left:0;
border:1px solid #d9d9d9;
border-radius:50%;
}
label .radio-inner:after{
content:‘‘;
position:absolute;
width:10px;
height:10px;
top:6px;
left:6px;
background:#fff;
border-radius:50%;
}
label>input:checked+.radio-inner:before{
border-color:#009a61;
}
label>input:checked+.radio-inner:after{
background:#009a61;
}
</style>
</head>
<body>
<label for="radio1">
<input type="radio" id="radio1" checked name="radio" />
<div class="radio-inner">
<div class="radio-title">radio1</div>
</div>
</label>
<label for="radio2">
<input type="radio" id="radio2" name="radio" />
<div class="radio-inner">
<div class="radio-title">radio2</div>
</div>
</label>
</body>
</html>

表单单选按钮美化

标签:

原文地址:http://www.cnblogs.com/xj198197/p/5968936.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!