我在前台写的用Repeater遍历输出一组checkBox,代码<asp:Repeater ID="Repeater9" runat="server">
<ItemTemplate>
<li>
<asp:CheckBox ID="CheckBox1" style="width:10px" runat="server" Text='<%#Eval("name") %>'></asp:CheckBox>
</li>
</ItemTemplate>
</asp:Repeater>
读取也正确了,现在的问题是显示的文字紧紧挨着框框,怎么写个样式,让框框和文字中间留点空隙CheckBox
<ItemTemplate>
<li>
<asp:CheckBox ID="CheckBox1" style="width:10px" runat="server" Text='<%#Eval("name") %>'></asp:CheckBox>
</li>
</ItemTemplate>
</asp:Repeater>
读取也正确了,现在的问题是显示的文字紧紧挨着框框,怎么写个样式,让框框和文字中间留点空隙CheckBox
<input type="checkbox" id="chk<%# Eval("ID")%>" value="<%# Eval("ID")%>" /> <%# Eval("name")%>
.mspan input
{
margin-right:5px;
}
.mspan
{
margin-right:20px;
}
</style><asp:CheckBox ID="CheckBox1" runat="server" Text="济南" CssClass="mspan" /><asp:CheckBox ID="CheckBox2" runat="server" CssClass="mspan" Text="山东" />
2、参考:http://blog.csdn.net/lifen_zhang/article/details/5415768
.mspan label
{
font-size:12px; line-height:160%;
}
.mspan input
{
margin-right:5px;
}
.mspan
{
margin-right:20px;
margion-bottom; }
</style>
直接这么写吗,不好使呀
<style>
.mspan input
{
margin-right:5px;
}
.mspan
{
margin-right:20px;
}
.mspan label
{
font-size:12px; line-height:160%;
}
</style>
使用HtmlGenericControl来解决:
http://www.cnblogs.com/insus/articles/2037385.html