How can you text align center in asp.net 4.0 ListBox element. I tried cssclass but not working. Thank you.
This works for me:
<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>