<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>表单美化_复选按钮篇</title>
<link rel="stylesheet" type="text/css" href="css/public.css"/>
<style type="text/css">
body{font:12px/22px "微软雅黑";}
.checkbox {
margin: 20px auto;
width: 520px;
}
.checkbox ul {
height: 30px;
overflow: hidden;
border: 1px solid #D4D4D4;
border-width: 1px 0;
padding-left: 10px;
}
.checkbox ul li {
float: left;
height: 30px;
line-height: 30px;
margin-right: 10px;
position: relative;
text-indent: 1px;
}
.checkbox ul li input {
display: none;
}
.checkbox ul li label {
padding-left: 23px;
}
.checkbox ul li b {
top: 6px;
width: 20px;
height: 20px;
position: absolute;
left: 0px;
background: url("images/checkbox.gif") no-repeat -10px -18px;
}
.checkbox ul li :hover b {
background-position: -10px -118px;
}
</style>
<script type="text/javascript">
function createTag() {
var li = document.getElementById("checkList").getElementsByTagName("li");
for (var i = 0; i < li.length; i++) {
var label = li[i].getElementsByTagName("label");
var b = document.createElement("b");
li[i].insertBefore(b, label[0]);
}
}
function checkList() {
}
function addLoadEvent(fn) {
var oldOnload = window.onload;
if (typeof window.onload != "function") {
window.onload = fn;
} else {
window.onload = function () {
oldOnload();
fn();
}
}
}
addLoadEvent(createTag);
addLoadEvent(checkList);
</script>
</head>
<body>
<div class="checkbox">
<form action="#" method="post" name="typeForm">
<ul id="checkList">
<li class="select"><input type="checkbox" name="type" id="x" value=""/><label for="x">消费者保障</label></li>
<li><input type="checkbox" name="type" id="po" value=""/><label for="po">破损补寄</label></li>
<li><input type="checkbox" name="type" id="s" value=""/><label for="s">7天退换</label></li>
<li><input type="checkbox" name="type" id="z" value=""/><label for="z">正品保障</label></li>
<li><input type="checkbox" name="type" id="d" value=""/><label for="d">电子凭证</label></li>
<li><input type="checkbox" name="type" id="wang" value=""/><label for="wang">旺旺在线</label></li>
<li><input type="checkbox" name="type" id="p" value=""/><label for="p">品牌授权</label></li>
<li><input type="checkbox" name="type" id="h" value=""/><label for="h">货到付款</label></li>
<li><input type="checkbox" name="type" id="cre" value=""/><label for="cre">信用卡</label></li>
</ul>
</form>
</div>
</body>
</html>