I'm involved in making bus booking sites project. I need to use the seats to book. So, can we replace checkbox with the image. If Possible, please tell me. Or, if there is any other possibility, please furnish me with ideas. Thnku.
Asked
Active
Viewed 1.3k times
-4
-
2is this what you were looking for? http://stackoverflow.com/questions/16352864/how-to-display-image-in-place-of-checkbox – Jascha Goltermann May 28 '14 at 09:16
-
1Using google is always a possibility http://stackoverflow.com/questions/3772273/pure-css-checkbox-image-replacement -> http://jsfiddle.net/4huzr/ – SubjectCurio May 28 '14 at 09:17
1 Answers
4
offer a simple solution to css DEMO
HTML
<input type="checkbox" id="checkbox-id" /> <label for="checkbox-id">Some label</label>
CSS
input[type="checkbox"] {
position: absolute;
left: -9999px;
}
input[type="checkbox"] + label {
background: url(http://xandeadx.ru/examples/styling-checkbox/checkbox-sprite.gif) 0 0 no-repeat;
padding-left: 20px;
}
input[type="checkbox"]:checked + label {
background-position: 0 -32px;
}

AndrewWhite
- 310
- 1
- 8
-
You could just hide the checkbox with `display:none` or `visibility:hidden` instead of using absolute positioning though...couldn't you? – Paulie_D May 28 '14 at 09:58
-