(→개요) |
(→개요) |
||
16번째 줄: | 16번째 줄: | ||
} | } | ||
input[type=checkbox]:checked + label > div { | 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 | background: url('//mediawiki.org/static/1.27.0-wmf.3/resources/lib/oojs-ui/themes/mediawiki/images/icons/check-constructive.png') center; | ||
} | } | ||
</style> | </style> |
2015년 10월 28일 (수) 17:07 판
1 개요
- CSS 큰 체크박스 만들기 2
html
Copy
<style>
input[type=checkbox] { display: none; }
input[type=checkbox] + label { cursor: pointer; }
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;
}
</style>
<input type="checkbox" id="box1"><label for="box1"><div></div> 동의합니다.</label>
<br><br>
<input type="checkbox" id="box2"><label for="box2"><div></div> 동의합니다.</label>
<br><br>
<input type="checkbox" id="box3"><label for="box3"><div></div> 동의합니다.</label>