I have an ASP.NET checkboxlist with "chkboxlistnames" as the class:
<asp:CheckBoxList ID ="chkName" runat="server" RepeatDirection="Horizontal" CssClass="chkboxlistnames" >
<asp:ListItem Text="" Value="" ></asp:ListItem>
</asp:CheckBoxList>
I populate this checkbox by using jQuery, Ajax and JSON method. After rendering HTML shows like this:
<table id="MainContent_chkName" class="chkboxlistnames">
<tbody>
<tr>
<td>
<input id="MainContent_chkName_0" name="UserID" value="2009" type="checkbox">
<label for="MainContent_chkName_0">[email protected],Lekshmi</label>
</td>
</tr>
</tbody>
</table>
CSS:
input[type="checkbox"]:not(old) + label {
display: inline-block;
margin-left: -8px;
background: url('../img/checks.png') no-repeat 197px 1px;
line-height: 24px;
width: 222px;
text-align: left;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: 700;
}
This style is used for all checkboxes in this application, but I want a separate CSS for this checkbox using class chkboxlistnames, how to do that?
input[type="checkbox"]:not(old) + label {asinput[class="chkboxlistnames"]:not(old) + label {input[class="chkboxlistnames"]and not just useinput.chkboxlistnames?