效果图:
HTML源码 :替换<script type="text/javascript" src="/js/jquery/jquery-1.4.2.min.js"></script> 路径可以运行
<!doctype html>
<html><head>
<meta charset="utf-8">
<title>选择框样式</title>
<style>
.ntc_checkbox input[type="checkbox"],input[type="radio"] {
display: none;
}
.ntc_checkbox .ntc_radio_item{
font-family: heiti-sc, 微软雅黑, Arial, Helvetica, Georgia, 'Bitstream Charter', serif;
height: 22px;
line-height: 22px;
font-size: 12px;
cursor: pointer;
margin:0px auto;
/**内容居中**/
text-align:center;
vertical-align:middle;
/**内容宽度自适应**/
display:inline-block;
*display:inline;
*zoom:1;
}
.ntc_radio_item span:hover {
background-color: #ff9e50;
color: #fff;
}
.ntc_radio_item span:active{
position:relative;
top:1px;
}
.ntc_radio_item span{
text-align: center;
vertical-align:middle;
display:block;
height: 22px;
line-height: 22px;
-webkit-border-radius: 3px;
border-radius: 2px;
padding: 2px 6px;
margin-right:2px;
color: #9e9e9e;
}
.ntc_checkbox .ntc_checkbox_item {
font-family: heiti-sc, 微软雅黑, Arial, Helvetica, Georgia, 'Bitstream Charter', serif;
height: 22px;
line-height: 22px;
font-size: 12px;
cursor: pointer;
margin:0px auto;
/**内容居中**/
text-align:center;
vertical-align:middle;
/**内容宽度自适应**/
display:inline-block;
*display:inline;
*zoom:1;
}
.ntc_checkbox_item span:hover {
background-color: #ff9e50;
color: #fff;
}
.ntc_checkbox_item span:active{
position:relative;