jeudi 19 février 2015

Aligning HTML checkbox and label [duplicate]


This question already has an answer here:




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?





Aucun commentaire:

Enregistrer un commentaire