asp.net 4.0 ListBox 元素中的文本如何对齐中心。我尝试了 cssclass 但没有工作。谢谢你。
问问题
2608 次
1 回答
0
这对我有用:
<style type="text/css">
.listbox-centered
{
width:400px;
text-align:center;
}
</style>
...
<asp:ListBox ID="listBox1" runat="server" CssClass="listbox-centered">
<asp:ListItem Text="Item 1" Value="0"></asp:ListItem>
<asp:ListItem Text="Item 2" Value="1"></asp:ListItem>
</asp:ListBox>
于 2011-09-26T19:24:39.460 回答