I am trying to display a border around each checkbox item in a checkboxlist. I believe that it can be achieved by setting the td cssclass as the checkboxlist saves items in td. However, the code I tried below is not working.
Here is the ASPX code:
<style type="text/css>
.chkboxlist td
{
font-size: large;
background-color: Green;
border-color: Red;
color: black;
}
</style>
<asp:CheckBoxList ID="chkCompanies" RepeatDirection="Vertical" CellSpacing="5" CellPadding="5" runat="server" CssClass="chkboxlist"></asp:CheckBoxList>
And here is the ASPX.cs code:
chkCompanies.DataSource = dtCompanyList;
chkCompanies.DataTextField = "Emp_Company";
chkCompanies.DataBind();
The CSS Class is placed in the head section of the ASPX code. Any suggestions on how to make this work?