濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > 單選按鈕、多選按鈕用圖片實(shí)現(xiàn)加樣式

單選按鈕、多選按鈕用圖片實(shí)現(xiàn)加樣式

熱門(mén)標(biāo)簽:電話機(jī)器人宣傳片 經(jīng)綸電銷機(jī)器人 華為收費(fèi)站地圖標(biāo)注 巫山縣地圖標(biāo)注app 外呼智能系統(tǒng)報(bào)價(jià) 個(gè)貸電銷機(jī)器人 浦東新區(qū)百度地圖標(biāo)注圖片 鄒城智能外呼系統(tǒng) 騰訊植物園地圖標(biāo)注
之前一直看到有人在問(wèn),單選按鈕和多選按鈕怎么加樣式、怎么把按鈕變大?下面把我做的一個(gè)例子分享出來(lái)。

1.首先把按鈕做成圖片
 

2.html頁(yè)面

復(fù)制代碼
代碼如下:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(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");
});
});
</script>
</head>
<style>
/* 多選/單選 */
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: 1px solid #049CDB;
}
.label_check input, .label_radio input {
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: 0 0px
}
.lblby label.c_on {
background-position: 0 -26px;
}
.lblby .label_radio {
background-position: 0 -52px;
}
.lblby label.r_on {
background-position: 0 -78px;
}
.lblby .label_check input, .lblby .label_radio input {
position: absolute;
left: -9999px;
}
</style>
<body class="lblby">
<label for="checkbox-01" class="label_check c_on">
<input type="checkbox" checked="checked" value="1" id="checkbox-01" name="sample-checkbox-01" />
Checkbox1 </label>
<label for="checkbox-02" class="label_check">
<input type="checkbox" value="1" id="checkbox-02" name="sample-checkbox-02" />
Checkbox2</label>
<label for="radio-01" class="label_radio r_on">
<input type="radio" value="1" checked="checked" id="radio-01" name="sample-radio" />
Radio1 </label>
<label for="radio-02" class="label_radio r_off">
<input type="radio" value="1" id="radio-02" name="sample-radio" />
Radio2 </label>
<label for="radio-03" class="label_radio r_off">
<input type="radio" value="1" id="radio-03" name="sample-radio" />
Radio3 </label>
</body>
</html>

標(biāo)簽:南平 那曲 日喀則 三沙 滁州 楊凌 廣西 唐山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《單選按鈕、多選按鈕用圖片實(shí)現(xiàn)加樣式》,本文關(guān)鍵詞  單選,按鈕,多選,用,圖片,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《單選按鈕、多選按鈕用圖片實(shí)現(xiàn)加樣式》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于單選按鈕、多選按鈕用圖片實(shí)現(xiàn)加樣式的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    虎林市| 信阳市| 徐汇区| 木兰县| 准格尔旗| 多伦县| 庆城县| 绩溪县| 青海省| 潮安县| 萨嘎县| 永寿县| 长垣县| 夏津县| 余姚市| 遵义市| 碌曲县| 贵港市| 阿拉善左旗| 越西县| 同江市| 宁津县| 乡城县| 铜山县| 偃师市| 建湖县| 溧阳市| 辽阳市| 三穗县| 德州市| 陇南市| 叙永县| 永康市| 内丘县| 尚义县| 涪陵区| 榆树市| 个旧市| 苏尼特右旗| 龙州县| 岫岩|