align the font of a drop down list box to center

Posted on 2005-04-24
Last Modified: 2013-12-03

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

Question by:EdwardPeter
    1 Comment
    LVL 9

    Accepted Solution

    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>

    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).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now