I have a DropDownList in my aspx file like this:
<asp:DropDownList runat="server" ID="MaxRec">
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
<asp:ListItem>150</asp:ListItem>
<asp:ListItem Selected="True">200</asp:ListItem>
</asp:DropDownList>
In Chrome it renders like this:
How can i set the alignment on all ListItems to be to the right so that values are properly aligned? I tried setting style="text-align:right" on the DropDownList and on the ListItems but it doesn't have any effect. I need a solution that also works on Chrome.
Thanks for replies!
the below code works for me
<head>
<style type="text/css">
select.myDropDownList {
text-align: right;
}
</style>
</head>
<asp:DropDownList ID="myDropDownList" Runat="server" CssClass="myDropDownList">
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
<asp:ListItem>150</asp:ListItem>
</asp:DropDownlist>