分享好友 前端技术首页 频道列表

div仿checkbox表单样式美化及功能有素材

css教程  2015-11-09 11:420
div仿checkbox表单样式美化及功能(checkbox的样式不好看)素材在底部:

效果图:
div仿checkbox表单样式美化及功能有素材 
window.css

复制代码
代码如下:

.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="font-size:12px;"><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函数:

复制代码
代码如下:

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" style="display: none; visibility: hidden; ">
<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" style="width:18px;" class="custom_checkbox_self">0</div><label for="MemberName">姓名</label></div>
<div><div id="Phone" style="width:18px;" class="custom_checkbox_self">0</div><label for="Phone">手机</label></div>
<div><div id="Company" style="width:18px;" class="custom_checkbox_self">0</div><label for="Company">企业</label></div>
<div><div id="Post" style="width:18px;" class="custom_checkbox_self">0</div><label for="Post">企业职位</label></div>
<div><div id="applyPosiGuid" style="width:18px;" class="custom_checkbox_self">0</div><label for="applyPosiGuid">申请职务</label></div>
</dd>
<dd>
<span>详细信息</span><br/>
<hr/>
<div><div id="Hometown" style="width:18px;" class="custom_checkbox_self">0</div><label for="Hometown">籍贯</label></div>
<div><div id="Gender" style="width:18px;" class="custom_checkbox_self">0</div><label for="Gender">性别</label></div>
<div><div id="Birthday" style="width:18px;" class="custom_checkbox_self">0</div><label for="Birthday">生日</label></div>
<div><div id="Nation" style="width:18px;" class="custom_checkbox_self">0</div><label for="Nation">民族</label></div>
<div><div id="Party" style="width:18px;" class="custom_checkbox_self">0</div><label for="Party">政治面貌</label></div>

<div><div id="IdentityCard" style="width:18px;" class="custom_checkbox_self">0</div><label for="IdentityCard">身份证</label></div>
<div><div id="EducationLevel" style="width:18px;" class="custom_checkbox_self">0</div><label for="EducationLevel">学历</label></div>
<div><div id="Telephone" style="width:18px;" class="custom_checkbox_self">0</div><label for="Telephone">电话</label></div>
<div><div id="Fax" style="width:18px;" class="custom_checkbox_self">0</div><label for="Fax">传真</label></div>
<div><div id="Email" style="width:18px;" class="custom_checkbox_self">0</div><label for="Email">邮箱</label></div>
</dd>
<dd>
<span>企业信息</span><br/>
<hr/>
<div><div id="CompanyAddress" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyAddress">地址</label></div>
<div><div id="CompanyStaffNumber" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyStaffNumber">员工数</label></div>
<div><div id="CompanyLegalPerson" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyLegalPerson">法人代表</label></div>
<div><div id="CompanyCreatedDate" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyCreatedDate">成立时间</label></div>
<div><div id="CompanyProperty" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyProperty">企业性质</label></div>

<div><div id="CompanyIsPublic" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyIsPublic">是否上市</label></div>
<div><div id="CompanyIndustry" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyIndustry">所属行业</label></div>
<div><div id="CompanyWebsite" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyWebsite">网址</label></div>
<div><div id="CompanyAssets" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyAssets">企业资产</label></div>
</dd>
<dd>
<span>附件</span><br/>
<hr/>
<div><div id="CompanyPicUrl" style="width:18px;" class="custom_checkbox_self">0</div><label for="CompanyPicUrl">营业执照复印件</label></div>
<div><div id="IdentityPicUrl" style="width:18px;" class="custom_checkbox_self">0</div><label for="IdentityPicUrl">身份证照片</label></div>
<div style="width:150px;"><div id="PersionPicUrl" style="width:18px;" 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表单样式美化及功能有素材

查看更多关于【css教程】的文章

展开全文
相关推荐
反对 0
举报 0
评论 0
图文资讯
热门推荐
优选好物
更多热点专题
更多推荐文章
[select][option][checkbox]">HTML标签天天练7--表单2<form>[select][option][checkbox]
——继续form表单的第二篇学习:有些时候,需要调用到一些下拉选项,比如国家、省份、城市,等等,但既要保证页面的整齐洁净,又要实现功能的情况下,我们就可以使用下拉式的选项:如下:htmlbodyformselect name="coutry"option value="american"American/op

0评论2023-03-08889

bootstrap checkbox选中事件
https://blog.csdn.net/liuxl_0205/article/details/89326260bootstrap checkbox change状态获取$("body").on('ifChanged', '.checkExtPrize', function(e){var str = 'nbspnbspselect class="form-control goodsChoice" style=&qu

0评论2023-03-08963

jquery checkbox 限制多选的个数
2015年11月6日 16:32:49选中第四个的时候提示超过了3个, 点解alert框取消后, 将最后一个选中的checkbox取消选中 1 script 2 $(document).ready(function (){ 3 $('input[type=checkbox]').click(function(){ 4 if ($("input[name='contract[]']:checked").len

0评论2023-03-08618

jquery checkbox 复选框多次点击判断选中状态,以及全选/取消的代码示例
2015年12月21日 10:52:51 星期一目标, 点击当前的checbox, 判断点击后当前checkbox是否是选中状态.html:input type="checkbox" onclick="contracts_checkall()"全选js: 1 var checkall = $("#contracts_checkall").attr('checked');2 var checkall_value1 =

0评论2023-03-08321

(转)jquery serialize表单序列化,当radio或checkbox 未选中时,没有序列化到对象中的原因分析和解决方案 - ghostsf
相信很多人都用过jq的表单序列化serialize()方法,因为这能很方便地帮你把表单里所有的非禁用输入控件序列化为 key/value 对象,不需要你再去一个个地拼接参数了。这是一个很好用的函数,用过的你肯定知道。但是ghostsf最近发现一个小bug(也许不应该叫bug,

0评论2023-03-08515

jquery选中checkbox多选项并添加到文本框中
  scriptfunction check(){var dd = ""; if($("input[type='checkbox'][name='mokedoc']:checked").attr("checked")){//选中了 $('input:checkbox[name="mokedoc"]:checked').each(function() {alert($(

0评论2023-02-08512

angular 指令梳理 —— checkBox
 checkBox 持久化数据为 逗号分割 /** * 功能说明: * htCheckbox 指令用于收集checkbox数据。 * 在页面中使用* 属性指令:ht-checkbox * 对应的值为scope对应的数据data.users=“1,3”。 * 示例:div input type="checkbox" ht-checkbox ng-model="data.user

0评论2023-02-08486

bootstrap table 自定义checkbox样式
//cssstyle.checkbox-custom {position: relative;padding: 0 15px 0 25px;margin-bottom: 7px;margin-top: 0;display: inline-block;}/*将初始的checkbox的样式改变*/.checkbox-custom input[type="checkbox"] {opacity: 0;/*将初始的checkbox隐藏起来*/posi

0评论2023-02-08500

多个 label checkbox 组合 显示在同一个水平线上[前提Bootstrap框架]
th align="left" valign="middle"label class="checkbox inline font-size"input type="checkbox" 真实评价/label/th

0评论2023-02-08415

JQuery 遍历table中的checkbox 并对行数据进行校验
 JQuery中confirm的使用 $(document).ready(function () {$("#Btn_Print").click(function () {var returns = true;$('#table1 input:checkbox').each(function () {if ($(this).is(':checked')) {var row = $(this).parent("td").paren

0评论2023-02-08745

[jQ]jQuery显式操作Checkbox,并用数组存储关联值的方案
 --------------------------------------------------------------------------/** * 显式选中清空Checkbox(jQuery代码) */var obj = $(':checkbox');obj.on('click',function(){oThis = $(this); if(oThis.attr('selected') == 'selected'

0评论2023-02-08542

checkbox在jquery版本1.9 以上用attr不可重复操作的问题【附解决方案】
最近做个项目,需要重复多次更改checkbox的状态,使用jquery 1.10.2的最新版本时发现,对checkbox的选中状态无法多次选中。测试代码如下: 1 !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transi

0评论2023-02-08998

React中 checkbox 与 label 标签的搭配
用label标签替代checkbox的点击样子,点击label实际上就是点击checkbox checkbox的checked值会跟着一起变input type="checkbox" style={{display:'none'}} id={"checkbox"} onChange={this.handlerChange.bind(this)}/input label htmlFor={"checkbox"}/label

0评论2023-02-08844

antd vue 如何调整checkbox默认样式
目录antd vue 调整checkbox默认样式antd中table内添加checkbox踩坑总结antd vue 调整checkbox默认样式// 鼠标hover时候的颜色.ant-checkbox-wrapper:hover .ant-checkbox-inner,.ant-checkbox:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-c

0评论2023-02-08900

vue input复选框checkbox默认样式纯css修改
div class="data_list" v-for="(item,index) in data_list" :key="index"input type="checkbox" class="check_box tui-checkbox" :label :for="'id'+item.id" class="title"{{item.title}}

0评论2023-02-08528

更多推荐