【发布时间】:2014-03-28 05:30:11
【问题描述】:
我的复选框列表非常难看。盒子没有正确对齐。看截图。
【问题讨论】:
-
可以贴出你用过的HTML代码吗?
-
@SpiderCode 添加代码
-
@Jordjmax 增加宽度,确保文本单行显示。
标签: c# webforms checkboxlist
我的复选框列表非常难看。盒子没有正确对齐。看截图。
【问题讨论】:
标签: c# webforms checkboxlist
我想提一下,您的复选框列表将坚持 Width="195px"。 因此,我的建议是根据您的设计增加宽度或将其删除,如下所述:
<asp:CheckBoxList runat="server" ID="cblType"
OnSelectedIndexChanged="cblType_OnSelectedIndexChanged" AutoPostBack="True"
RepeatDirection="Horizontal">
<Items>
<asp:ListItem Text="IPP Stories" Value="IPP Stories"></asp:ListItem>
<asp:ListItem Text="OutReach Activities " Value="OutReach Activities"></asp:ListItem>
<asp:ListItem Text="CCA" Value="CCA"></asp:ListItem>
<asp:ListItem Text="Community Work" Value="Community Work"></asp:ListItem>
<asp:ListItem Text="Competition" Value="Competition"></asp:ListItem>
<asp:ListItem Text="Overseas Experience" Value="Overseas Experience"></asp:ListItem>
<asp:ListItem Text="FYPJ" Value="FYPJ"></asp:ListItem>
</Items>
</asp:CheckBoxList>
建议:
如果我遇到这种情况,那么我会通过在 CheckboxList 属性中添加 RepeatColumns="3" 或 RepeatColumns="4" 将其分成两行。
【讨论】:
我认为您不需要在这里指定任何宽度,尽量不要,也许它会完成这项工作。如果没有,请发布相关的 css 样式(如果有)...
<asp:CheckBoxList runat="server" ID="cblType"
OnSelectedIndexChanged="cblType_OnSelectedIndexChanged" AutoPostBack="True"
RepeatDirection="Horizontal">
【讨论】: