如何用div仿checkbox表單樣式美化及功能

本篇內(nèi)容主要講解“如何用div仿checkbox表單樣式美化及功能”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“如何用div仿checkbox表單樣式美化及功能”吧!

成都創(chuàng)新互聯(lián)公司服務項目包括巴彥淖爾網(wǎng)站建設、巴彥淖爾網(wǎng)站制作、巴彥淖爾網(wǎng)頁制作以及巴彥淖爾網(wǎng)絡營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關系等,向廣大中小型企業(yè)、政府機構等提供互聯(lián)網(wǎng)行業(yè)的解決方案,巴彥淖爾網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務的客戶以成都為中心已經(jīng)輻射到巴彥淖爾省份的部分城市,未來相信會繼續(xù)擴大服務區(qū)域并繼續(xù)獲得客戶的支持與信任!

div仿checkbox表單樣式美化及功能(checkbox的樣式不好看)素材在底部:

代碼如下:

.bj {
position: absolute;
top: 0;
left: 0;
bottom: 1px;
width: 100 % ;
height: 980px;
z - index: 9;
background - color: #000;
filter: alpha(opacity = 50); - moz - opacity: 0.5; - khtml - opacity: 0.5;
opacity: 0.5;
}
.window {
position: absolute;
top: 106px;
left: 33 % ;
width: 466px;
background - color: #fff;
color: #000;
border - bottom: 1px solid#dbdcdd;
padding - bottom: 8px;
overflow: hidden;
z - index: 10;
}.window.top {
width: 416px;
padding: 0px 25px 0 25px;
height: 48px;
line - height: 48px;
font - size: 18px;
background - color: #ececec;
border - bottom: 1px solid#d8d8d8;
overflow: hidden;
}.window.top.close {
float: right;
margin - top: 14px;
}.window.top span {
padding: 0 6px;
}
.window.add {
width: 394px;
margin: 0 auto;
padding - top: 10px;
font - size: 15px;
color: #686868;
overflow: hidden;
}.window.add dd,
.window.add dt {
width: 100 % ;
padding - bottom: 8px;
line - height: 38px;
overflow: hidden;
}.window.add span {
float: left;
width: 69px;
overflow: hidden;
}.window.add dd input {
width: 314px;
height: 36px;
line - height: 36px;
border: 1px solid#c9c5c1;
background - color: #f2f2f2;
font - family: "微軟雅黑",
"宋體";
font - size: 15px;
color: #686868;
}.window.add dt input {
vertical - align: middle;
margin - right: 10px;
}.window.add dt label {
margin - right: 10px;
margin - left: 20px;
}.window.add dt label.perlabel {
margin - left: 0px;
}.window.add dd input.two {
width: 192px;
height: 33px;
line - height: 33px;
border: none;
background: url('../images/input09.gif') no - repeat;
margin - right: 13px;
}.window.add dd a {
margin - left: 10px;
font - size: 16px;
}.window.add dt.button {
text - align: center;
padding - top: 8px;
}.window.add dt.button input {
width: 103px;
height: 41px;
line - height: 39px;
text - align: center;
border: none;
background: url('../images/input06.gif') no - repeat;
margin: 0 5px;
font - family: "微軟雅黑",
"宋體";
font - size: 15px;
color: #686868;
}.window.post {
width: 420px;
}.window.post span {
width: 86px;
}.window.post dt {
line - height: 26px;
}.window.post dt span {
height: 108px;
line - height: 108px;
}.window.post dt label {
width: 100px;
float: left;
}.window.post dt label.perlabel {
float: none;
}.window.post textarea {
width: 312px;
height: 62px;
line - height: 24px;
border: 1px solid#c9c5c1;
background - color: #f2f2f2;
font - family: "微軟雅黑",
"宋體";
font - size: 14px;
color: #686868;
}.window.post dd input.three {
width: 238px;
margin - right: 10px;
}.window.
default {
width:
406px;
}
.window.
default span {
width:
52px;
}.window.
default dd select {
width:
38px;
margin:
0 6px;
}.window.
default dd textarea {
width:
350px;
}.window.
default dd b {
float:
right;
margin - right: 5px;
font - weight: normal;
}.window.
default dd b input {
width:
auto;
height:
auto;
margin - right: 5px;
}


頁面中的css

代碼如下:


<span ><style type="text/css">
.window{
left:25%;
width:676px;
}
.window .top{
width:626px;
}
.window span{
font-family:"微軟雅黑";
font-weight: bold;
}
.window .post{
width:645px;
}
.window .post label{
font-size: 13px;
}
.window dl{
margin-left:25px !important;
}
.window .post hr{
width:230px;
text-align: left;
margin-bottom: 20px;
}
.window .add dd div{
width:125px;
float:left;
vertical-align: middle;
height: 18px;
line-height: 18px;
}
.custom_checkbox_self{
width:18px;
height:18px;
text-indent:100px;
overflow:hidden;
float:left;
background:url(../images/custom_checkbox.png);
margin-right:10px;
}
</style></span>


js函數(shù):

代碼如下:


function openJoinSetting(){
var joinSetting = document.getElementById('joinSetting');
joinSetting.style.display='block';
joinSetting.style.visibility='visible';
document.getElementById('back2').style.display='block';
document.getElementById('wiSsetting').style.display='block';
}
$(document).ready(function(){
$(".custom_checkbox_self").click(function(){
if($(this).text().trim()=="0"){
$(this).css("background","url(../images/custom_checkbox_checked.png)");
$(this).text('1');
}else{
$(this).css("background","url(../images/custom_checkbox.png)");
$(this).text('0');
}
});
});


窗口代碼:

代碼如下:


<div id="joinSetting" >
<div id="back2" class="bj"></div>
<div id="wiSsetting" class="window">
<div class="top">
<a href="javascript:closealbum();" class="close"><img
src="../images/icon03.gif" alt="關閉" /> </a>申請表必填項設置</div>
<dl class="add post">
<dd>
<span>基本信息</span><br/>
<hr/>
<div><div id="MemberName"  class="custom_checkbox_self">0</div><label for="MemberName">姓名</label></div>
<div><div id="Phone"  class="custom_checkbox_self">0</div><label for="Phone">手機</label></div>
<div><div id="Company"  class="custom_checkbox_self">0</div><label for="Company">企業(yè)</label></div>
<div><div id="Post"  class="custom_checkbox_self">0</div><label for="Post">企業(yè)職位</label></div>
<div><div id="applyPosiGuid"  class="custom_checkbox_self">0</div><label for="applyPosiGuid">申請職務</label></div>
</dd>
<dd>
<span>詳細信息</span><br/>
<hr/>
<div><div id="Hometown"  class="custom_checkbox_self">0</div><label for="Hometown">籍貫</label></div>
<div><div id="Gender"  class="custom_checkbox_self">0</div><label for="Gender">性別</label></div>
<div><div id="Birthday"  class="custom_checkbox_self">0</div><label for="Birthday">生日</label></div>
<div><div id="Nation"  class="custom_checkbox_self">0</div><label for="Nation">民族</label></div>
<div><div id="Party"  class="custom_checkbox_self">0</div><label for="Party">政治面貌</label></div>

<div><div id="IdentityCard"  class="custom_checkbox_self">0</div><label for="IdentityCard">身份證</label></div>
<div><div id="EducationLevel"  class="custom_checkbox_self">0</div><label for="EducationLevel">學歷</label></div>
<div><div id="Telephone"  class="custom_checkbox_self">0</div><label for="Telephone">電話</label></div>
<div><div id="Fax"  class="custom_checkbox_self">0</div><label for="Fax">傳真</label></div>
<div><div id="Email"  class="custom_checkbox_self">0</div><label for="Email">郵箱</label></div>
</dd>
<dd>
<span>企業(yè)信息</span><br/>
<hr/>
<div><div id="CompanyAddress"  class="custom_checkbox_self">0</div><label for="CompanyAddress">地址</label></div>
<div><div id="CompanyStaffNumber"  class="custom_checkbox_self">0</div><label for="CompanyStaffNumber">員工數(shù)</label></div>
<div><div id="CompanyLegalPerson"  class="custom_checkbox_self">0</div><label for="CompanyLegalPerson">法人代表</label></div>
<div><div id="CompanyCreatedDate"  class="custom_checkbox_self">0</div><label for="CompanyCreatedDate">成立時間</label></div>
<div><div id="CompanyProperty"  class="custom_checkbox_self">0</div><label for="CompanyProperty">企業(yè)性質(zhì)</label></div>

<div><div id="CompanyIsPublic"  class="custom_checkbox_self">0</div><label for="CompanyIsPublic">是否上市</label></div>
<div><div id="CompanyIndustry"  class="custom_checkbox_self">0</div><label for="CompanyIndustry">所屬行業(yè)</label></div>
<div><div id="CompanyWebsite"  class="custom_checkbox_self">0</div><label for="CompanyWebsite">網(wǎng)址</label></div>
<div><div id="CompanyAssets"  class="custom_checkbox_self">0</div><label for="CompanyAssets">企業(yè)資產(chǎn)</label></div>
</dd>
<dd>
<span>附件</span><br/>
<hr/>
<div><div id="CompanyPicUrl"  class="custom_checkbox_self">0</div><label for="CompanyPicUrl">營業(yè)執(zhí)照復印件</label></div>
<div><div id="IdentityPicUrl"  class="custom_checkbox_self">0</div><label for="IdentityPicUrl">身份證照片</label></div>
<div ><div id="PersionPicUrl"  class="custom_checkbox_self">0</div><label for="PersionPicUrl">個人名片照片</label></div>
</dd>
<dt class="button">
<input name="" type="submit" value="確認" onclick=""/>
<input name="" type="button" value="取消" onclick="" />
</dt>
</dl>
</div>
</div>


這是一個彈出層的表單選擇。

圖片素材:
如何用div仿checkbox表單樣式美化及功能
如何用div仿checkbox表單樣式美化及功能

到此,相信大家對“如何用div仿checkbox表單樣式美化及功能”有了更深的了解,不妨來實際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關內(nèi)容可以進入相關頻道進行查詢,關注我們,繼續(xù)學習!

網(wǎng)頁題目:如何用div仿checkbox表單樣式美化及功能
當前路徑:http://muchs.cn/article46/gepihg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供自適應網(wǎng)站、網(wǎng)站維護手機網(wǎng)站建設、域名注冊微信公眾號、商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)