css ul li checkbox 格式

<td class="tddata">
                        <% if (aq == 1) { model.NoticeType = 1; } %>
                        <%--<select id="txtClassId" name="txtClassId" onchange="seleTypeImg()">
                            <% foreach (HX.Model.ADM.T_ADM_DataType data in list)
                                {%>
                            <option value="<%=data.TypeCode %>" <%=data.TypeCode==model.NoticeType?"selected":"" %>>
                                <%=data.TypeName%></option>
                            <%} %>
                        </select>--%>
                        <ul class="noticeType">
                         <% foreach (var item in list)
                            {
                                string chk = "";
                                if(model!=null && model.NoticeTypeList != null) { 
                                chk=model.NoticeTypeList.Where(t => t.Key == item.TypeCode).ToList().Count > 0 ? chk = "checked='checked'" : "";}
                        %>
                        <li><input type="checkbox" name="cheType" value="<%=item.TypeCode %>" <%=chk %> data-name="<%=item.TypeName %>" /><%=item.TypeName %></li>
                        <%
                            } %>
                            </ul>
                    </td>
View Code
 <style type="text/css">
        .tddata input{margin-right:0px;vertical-align:sub;width:auto;}
        .noticeType li{float:left;line-height:30px;width:120px;list-style:none;}
        .noticeType{padding-left:0px;}
    </style>
View Code
收藏
关注
评论
原文地址:https://www.cnblogs.com/yidengbone/p/7659561.html