美化复选框

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>canvas</title>
    <script src="js/jquery-1.9.1.min.js"></script>
</head>
<body>

<style>
.Checkbox{
    position: relative;
}
.regular-checkbox{
    display: none;
}
.regular-checkbox + label {
    background-color: #fafafa;
    border: 1px solid #cacece;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
    padding: 9px;
    border-radius: 3px;
    display: inline-block;
    position: relative;
}

.regular-checkbox + label:active, .regular-checkbox:checked + label:active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);
}

.regular-checkbox:checked + label {
    background-color: #e9ecee;
    border: 1px solid #adb8c0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);
    color: #99a1a7;
}

.regular-checkbox:checked + label:after {
    content: '\2714';
    width: 14px;
    height: 14px;
    font-size: 14px;
    position: absolute;
    top: 0px;
    left: 3px;
    color: #99a1a7;
    /* border-radius: 50px;
   background:url(images/logo.png) repeat;
    box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);*/

}


.big-checkbox + label {
    padding: 18px;
}
.big-checkbox:checked + label:after {
    content: '\2714';
    width: 28px;
    height: 28px;
    font-size:28px;
    position: absolute;
    top: 0px;
    left: 8px;
    color: #99a1a7;
    /*border-radius: 50px;
    background:url(images/logo.png) repeat;
    box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);*/
}

.tag {
    font-family: Arial, sans-serif;
    width: 200px;
    position: relative;
    top: 5px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    float: left;
}


</style>
<div class="Checkbox">
    <p> IE9以上版本支持</p>
    <div>
        <div class="tag">Checkbox Small</div>
        <input type="checkbox" id="checkbox-1-1" class="regular-checkbox" /><label for="checkbox-1-1"></label>
        <input type="checkbox" id="checkbox-1-2" class="regular-checkbox" /><label for="checkbox-1-2"></label>
        <input type="checkbox" id="checkbox-1-3" class="regular-checkbox" /><label for="checkbox-1-3"></label>
        <input type="checkbox" id="checkbox-1-4" class="regular-checkbox" /><label for="checkbox-1-4"></label>
    </div>
    <br />
    <div>
        <div class="tag">Checkbox Big</div>
        <input type="checkbox" id="checkbox-2-1" class="regular-checkbox big-checkbox" /><label for="checkbox-2-1"></label>
        <input type="checkbox" id="checkbox-2-2" class="regular-checkbox big-checkbox" /><label for="checkbox-2-2"></label>
        <input type="checkbox" id="checkbox-2-3" class="regular-checkbox big-checkbox" /><label for="checkbox-2-3"></label>
        <input type="checkbox" id="checkbox-2-4" class="regular-checkbox big-checkbox" /><label for="checkbox-2-4"></label>
    </div>

</div>

</body>
</html>

posted @ 2015-07-06 10:07  简单就好zyx  阅读(120)  评论(0编辑  收藏  举报