2

I have been struggling with correctly aligning HTML checkboxes and labels for a while now.

I have finally managed to get 2 checkboxes on the same line with labels to the right of the checkboxes.

I have one final problem to solve. The labels and the checkbboxes to do not align perfectly-the labels are a tiny bit higher than the checkboxes-see image:

enter image description here

It is a minor problem, but I think it is better to solve it.

The HTML is below:

        <span class="txtSmallGrey fl" style="display:block; width:200px; margin:15px; margin-top:30px"><%= oUtils.GetContentText("Collect_Config_Expense_return") %></span>
        <div style="margin-top:15px">
        <label class="txtSmallGrey fl" style="margin:15px"><input type="checkbox" onclick="fnOnCheck(ER_Enable)" id="ER_Enable" class="fl" style="width:15px; margin-right:5px; background:transparent; border:0"/><%= oUtils.GetContentText("Collect_Config_Enable") %></label>
        <label class="txtSmallGrey fl" style="margin:15px"><input type="checkbox" onclick="fnOnCheck(ER_Surpress)" id="ER_Surpress" class="fl" style="width:15px; margin-right:5px; background:transparent;border:0" /><%= oUtils.GetContentText("Collect_Config_Surpress") %></label>
        </div>

I have tried all the usual things eg margins and padding, but they are not having an effect.

Any ideas?

Alex
  • 3,730
  • 9
  • 43
  • 94
  • What is css for that? like for: `class="txtSmallGrey fl"` can you create fiddle of sample code? – ketan Feb 19 '15 at 08:43
  • @ketan It is text styling, but the problem has been solved from the above duplicate – Alex Feb 19 '15 at 08:49

0 Answers0