FAQ - General

Vertically Aligning ASP.NET Checkboxlist labels with checkboxes

In order to align the checkboxes and labels generated by ASP.NETS checkboxlist control, you need to apply the following CSS to the label element:

position: relative;
top: -4px;

You can do this using various CSS selectors, including  applying the above to all label element children of the table element parent of the checkboxlist control. For example, if you had the following:

<div id="checboxlistParent">
<asp:CheckBoxList ID="checkboxlist" runat="server">

The following CSS would apply the above CSS to all label elements in your checkboxlist:

#checboxlistParent label
position: relative;
top: -4px;

If you found this information useful, please share it!

This FAQ was last updated on Wednesday, September 30, 2015

Contact Information

To find out more about Ava solutions you can contact us in a number of ways:
Follow Us...