"CSS 큰 체크박스 (이미지 1개)"의 두 판 사이의 차이

4번째 줄: 4번째 줄:
<source lang='html5'>
<source lang='html5'>
<style>
<style>
#mycheckbox {  
input[type=checkbox] { display: none; }
    display: none;  
input[type=checkbox] + label > div {
}
     vertical-align: middle;
#mycheckbox + label > div {
    display: inline-block;
     float: left;
     background: white;
     background: white;
     width: 1.2em; height: 1.2em;
     width: 20px; height: 20px;
    margin-top: -3px;
     border: 1px solid #777;
     border: 1px solid #777;
     border-radius: 2px;
     border-radius: 2px;
}
}
#mycheckbox:checked + label:before {
input[type=checkbox]:checked + label > div {
    content:"";
     background: url('//mediawiki.org/static/1.27.0-wmf.3/resources/lib/oojs-ui/themes/mediawiki/images/icons/check-constructive.png') center/24px;
    position: absolute;
    top: .42em; left: .42em;
    width: 1.2em; height: 1.2em;
     background-image: url('//mediawiki.org/static/1.27.0-wmf.3/resources/lib/oojs-ui/themes/mediawiki/images/icons/check-constructive.png');
}
}
</style>
</style>


<input type="checkbox" id="mycheckbox"> <label for='mycheckbox'><div></div>&nbsp;동의합니다.</label>
<input type="checkbox" id="box1"><label for="box1"><div></div>&nbsp;동의합니다.</label>
<br><br>
<input type="checkbox" id="box2"><label for="box2"><div></div>&nbsp;동의합니다.</label>
<br><br>
<input type="checkbox" id="box3"><label for="box3"><div></div>&nbsp;동의합니다.</label>
</source>
</source>
<jsfiddle>f4bs1n4t</jsfiddle>
<jsfiddle>f4bs1n4t</jsfiddle>

2015년 10월 28일 (수) 15:49 판

1 개요

CSS 큰 체크박스 만들기 2
<style>
input[type=checkbox] { display: none; }
input[type=checkbox] + label > div {
    vertical-align: middle;
    display: inline-block;
    background: white;
    width: 20px; height: 20px;
    margin-top: -3px;
    border: 1px solid #777;
    border-radius: 2px;
}
input[type=checkbox]:checked + label > div {
    background: url('//mediawiki.org/static/1.27.0-wmf.3/resources/lib/oojs-ui/themes/mediawiki/images/icons/check-constructive.png') center/24px;
}
</style>

<input type="checkbox" id="box1"><label for="box1"><div></div>&nbsp;동의합니다.</label>
<br><br>
<input type="checkbox" id="box2"><label for="box2"><div></div>&nbsp;동의합니다.</label>
<br><br>
<input type="checkbox" id="box3"><label for="box3"><div></div>&nbsp;동의합니다.</label>

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}