tags:

views:

30

answers:

3

How do I style HTML controls as they could display as checkboxes using CSS, I have searched through google but couldn't find any good help.

<html>
<select size="4" multiple="multiple">
    <input type="checkbox" name="ckbx"> Data 01 <br>
    <input type="checkbox" name="ckbx"> Data 02 <br>
    <input type="checkbox" name="ckbx"> Data 03 <br>
    <input type="checkbox" name="ckbx"> Data 04 <br>
    ><input type="checkbox" name="ckbx"> Data 05 <br>

</select>
</html>  

Thanks.

A: 

This is not possible with CSS. You would have to change the HTML to make checkboxes from a select element. Maybe you could use an XSLT to change the HTML.

Sjoerd
+1  A: 

You cannot style selec dropdowns to have checkbox. You'll need to get this funcionality using javascript and emulate dropdown like appearance using css. There are a number of such scripts available, search for 'javascript multi select dropdown'

Gunjan
+1  A: 

use custom selectbox

jQuery Custom Select Box

Fatih Hayrioğlu