Results 1 to 4 of 4

Thread: select box width

  1. #1
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default select box width

    does anyone know how to set the width of a <select> box, including the drop-down button? For example,
    Code:
    select{ width: 150px; }
    creates this,

    but I want this


    thanks!
    Last edited by traq; 11-23-2010 at 03:31 AM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    What browser are you using? These have the same width on a Mac and a Windows in IE, Chrome, FF, and Opera.
    Code:
    <style type="text/css">
    #box { width: 200px; height: 5px; background: blue; }
    select { width: 200px; }
    </style>
    <div id="box"></div>
    <select>
    <option>SELECT</option>
    </select>
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    traq (11-23-2010)

  4. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    hmmm... crap. I must've made a typo somewhere in my original code. it works as expected now, though my original markup doesn't. debug time!

    thanks

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    No problem.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •