重慶分公司,新征程啟航
為企業(yè)提供網(wǎng)站建設(shè)、域名注冊、服務(wù)器等服務(wù)
為企業(yè)提供網(wǎng)站建設(shè)、域名注冊、服務(wù)器等服務(wù)
本文小編為大家詳細(xì)介紹“HTML單選和多選按鈕怎么給圖片加樣式”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“HTML單選和多選按鈕怎么給圖片加樣式”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識吧。
成都創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供高安網(wǎng)站建設(shè)、高安做網(wǎng)站、高安網(wǎng)站設(shè)計(jì)、高安網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、高安企業(yè)網(wǎng)站模板建站服務(wù),十余年高安做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
代碼如下:
$(function(){
$("input[type='checkbox']").click(function(){
if($(this).is(':checked')){
$(this).attr("checked","checked");
$(this).parent().removeClass("c_off").addClass("c_on");
}else{
$(this).removeAttr("checked");
$(this).parent().removeClass("c_on").addClass("c_off");
}
});
$("input[type='radio']").click(function(){
$("input[type='radio']").removeAttr("checked");
$(this).attr("checked","checked");
$(this).parent().removeClass("r_off").addClass("r_on").siblings().removeClass("r_on").addClass("r_off");
});
});
/*多選/單選*/
label{
display:block;
cursor:pointer;
line-height:26px;
margin-bottom:20px;
width:26px;
height:26px;
line-height:26px;
float:left;
margin-top:6px;
}
.radios{
padding-top:18px;
border-top:1pxsolid#049CDB;
}
.label_checkinput,.label_radioinput{
margin-right:5px;
}
.lblby.label_check,.lblby.label_radio{
margin-right:8px;
}
.lblby.label_radio,.lblby.label_check{
background:url(../images/jxc_btn.png)no-repeat;
}
.lblby.label_check{
background-position:00px
}
.lblbylabel.c_on{
background-position:0-26px;
}
.lblby.label_radio{
background-position:0-52px;
}
.lblbylabel.r_on{
background-position:0-78px;
}
.lblby.label_checkinput,.lblby.label_radioinput{
position:absolute;
left:-9999px;
}
Checkbox1
Checkbox2
Radio1
Radio2
Radio3