Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the space between checkboxes

Tags:

html

css

I have a form which contains several checkboxes align vertically in a div. I want to remove the space between each checkbox. But I can't find any solutions.

<div style="height:100px;width:25px;float:left;">
  <input type="checkbox"/>
  <input type="checkbox"/>
  <input type="checkbox"/>
  <input type="checkbox"/>
  <input type="checkbox"/>
  <input type="checkbox"/>
</div>

Does anyone have any solution to this problem?

like image 918
Billy Avatar asked Dec 03 '22 15:12

Billy


1 Answers

I found the solution:

  <input type="checkbox" style="margin: 0; padding 0;  height:13px"/>

For IE, you need to set the height to remove the space between checkboxes.

like image 119
Billy Avatar answered Dec 11 '22 17:12

Billy