Centering a drop-down menu?

Discussion in 'HTML & Website Design' started by draconusit, Aug 3, 2007.

  1. #1
    Well....I'm putting drop down menus on my website and my Myspace, and I searched for a snippet that made the drop down words center. Couldn't find anything. Does anyone know how to make this code center through out the entire menu?
    <select style="font-size:12px;color:&#035;FF0000;font-family:Comic Sans;background-color:&#035;000000;font-weight:bold;" name="menu">
    <option value>M*A*S*H*</option>
    <option value>Viva La Bam</option>
    <option value>Futurama</option>
    <option value>Family Guy</option>
    <option value>Simpsons</option>
    </select></p>
    Code (markup):

     
    draconusit, Aug 3, 2007 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you mean the select element itself or the options?
     
    Dan Schulz, Aug 4, 2007 IP
  3. draconusit

    draconusit Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I want to center the options
     
    draconusit, Aug 4, 2007 IP
  4. seo5000

    seo5000 Peon

    Messages:
    2,026
    Likes Received:
    231
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well if you are trying to center it on the page or section than just put this <center> at the beginning of your code and it should center it!!
     
    seo5000, Aug 4, 2007 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Which is a bad idea. Hold on, let me see if I can work some CSS magic.
     
    Dan Schulz, Aug 4, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    A> not what he's asking
    B> <CENTER>?!? How 1997 of you.

    On topic - It's in the specs that styling should not be able to be applied to the <option> tag - Opera and Safari obey this, but I believe firefox will actually work if you put

    option {
    text-align:center;
    }

    Not 100% sure on that though - I know it works with colors (which it is NOT supposed to)
     
    deathshadow, Aug 4, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Not only that but IE won't let you style either select or option (just tried it myself).
     
    Dan Schulz, Aug 4, 2007 IP