align the font of a drop down list box to center

Hi,

how can we align the font of a drop down list box to center?  (asp.net vb)

Thanks.
EdwardPeterAsked:
Who is Participating?
 
stengeljConnect With a Mentor Commented:
The <asp:listitem> won't let you do this.  Even if it did, IE would not recognize the 'center' attibute.  I think the best you can hope for is the following. It works in FireFox but not IE:

<select ID="mySelect" runat="server">
    <option value="1" style="text-align:center" >This</option>
    <option value="2" style="text-align:center" >This is</option>
    <option value="3" style="text-align:center" >This is a </option>
    <option value="4" style="text-align:center" >This is a test</option>
</select>

Maybe someone else knows a way, but I've been down this road before and I don't think it can be done (and still be suported by the major browsers).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.