How to center items in asp.net Dropdown list

Need help centering items in an asp.net Dropdown List. I have Select as the default list item and want to center that. Is that possible?

            <td> <asp:DropDownList ID="DropDownList6" runat="server" CssClass="ddl">
                <asp:ListItem>Select</asp:ListItem></asp:DropDownList></td>
.ddl li {
    text-align: center;
} 

That should work :slight_smile:

If you are talking about the html select element (I believe that’s what asp generates a DropDownList in html) then you can’t centre the text in the dropdown (at least not cross-browser - Firefox will centre with text-align:center but Chrome will not).

If you want the actual select centred (not the text only) then add display:block and margin:auto to the select element.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.